nerdexam
Python_Institute

PCAP-31-03 · Question #89

There is a stream named s open for writing. What option will you select to write a line to the stream''

The correct answer is A. s.write("Hello\n"). See the full explanation below for the reasoning.

Question

There is a stream named s open for writing. What option will you select to write a line to the stream''

Options

  • As.write("Hello\n")
  • Bwrite(s, "Hello")
  • Cs.writeln("Hello")
  • Ds.writeline("Hello")

How the community answered

(27 responses)
  • A
    74% (20)
  • B
    15% (4)
  • C
    4% (1)
  • D
    7% (2)

Community Discussion

No community discussion yet for this question.

Full PCAP-31-03 Practice