21
What is the output of the following code?
import io
f = io.StringIO('line1\nline2\n')
print(len(f.readlines()))DiscussMedium
Loading subject content…
Loading practice questions…
What is the output of the following code?
import io
f = io.StringIO('line1\nline2\n')
print(len(f.readlines()))What is the output of the following code?
import io
f = io.StringIO('hello\nworld\n')
print(f.readline().strip(), f.readline().strip())