A text file song .txt contains the following contents in it: Life goes on as…
PYQ Bihar STET 2025Modified — slightly modified from the official paper; see the solution
A text file song .txt contains the following contents in it:
Life goes on as it never ends
What will be the output of the following code snippet?
f1 = open ("song.txt", "r")
s1 = f1. read (5)
s2 = f1. readline (4)
s3 = f1. read (3)
print (s1, s3, sep = "#")- A.
goes # on
- B.
Life #goes # on
- C.
Life # on
- D.
Error
Attempted by 942 students.
Sign up free to check your answer
Sign up freeExplore the full course: Bihar Stet Computer Science Complete Course
Loading lesson…

