Examine the given Python program and select the best purpose of the program…
PYQ KVS TGT/PGT 2023
Examine the given Python program and select the best purpose of the program from the given options :
File=open("Poem.txt", "r")
print(len(File.readline().split()))
File.close()- A.
to count the number of words present in the file
- B.
to count the number of lines present in the file
- C.
to count the number of characters present in the file
- D.
to count the number of words present in the first line of the file
Attempted by 1675 students.
Sign up free to check your answer
Sign up freeLoading lesson…

