Test file

Report a typo

Suppose we have a file test.txt that looks like this:

This
is
a
test
file

Regard \n as the newline escape sequence.

We want to read 10 bytes from this file:

file = open("test.txt", 'r')
print(file.read(10))
file.close()

What will be the output of this code?

The options:

a)

This
is
a
tes

b)

This
is
a

c)

This
is
a
test
file

d)

This
 
Select one option from the list
___

Create a free account to access the full topic