nerdexam
Python_Institute

PCAP-31-03 · Question #119

What is the expected output of the following code if the file named existing_text_file is a non-zero length text file located inside the working directory?

The correct answer is B. -1. See the full explanation below for the reasoning.

Question

What is the expected output of the following code if the file named existing_text_file is a non-zero length text file located inside the working directory?

Exhibit

PCAP-31-03 question #119 exhibit

Options

  • Athe length of the first line from the file
  • B-1
  • Cthe number of lines contained inside the file
  • Dthe length of the last line from the file

How the community answered

(69 responses)
  • A
    3% (2)
  • B
    78% (54)
  • C
    13% (9)
  • D
    6% (4)

Community Discussion

No community discussion yet for this question.

Full PCAP-31-03 Practice