Certified Associate in Python Programming (PCAP) — Question 55

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

Answer options

Correct answer: A

Explanation

The correct answer is A because the method s.write() is specifically designed for writing to the stream, including the newline character. Options B, C, and D do not correctly utilize the stream object s in the context of writing a line as required by the question.