A text file named message.txt contains the following lines: Good morning. I…

PYQ EMRS TGT/PGT (ESSE) 2025

A text file named message.txt contains the following lines:
Good morning.
I will be there on time.
Consider the following Python code:
F = open('message.txt')
S1 = F.read(3)
S2 = F.readline(4)
S3 = F.read(4)
print(S1, S3, sep='@')
Which of the following will be the correct output of the above Python code?

  1. A.

    Goo@rnin

  2. B.

    Goo@I wi

  3. C.

    ValueError

  4. D.

    EOFError

Attempted by 353 students.

Sign up free to check your answer

Sign up free

Explore the full course: Emrs Cs Tier 2

Loading lesson…