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()
  1. A.

    to count the number of words present in the file

  2. B.

    to count the number of lines present in the file

  3. C.

    to count the number of characters present in the file

  4. 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 free

Explore the full course: Kvs Nvs Tier 2 Computer Science

Loading lesson…