Reading Between the Lines


#1

my_file=open("text.txt","r+")
print my_file.readline()
print my_file.readline()
print my_file.readline()
my_file.close()


#2

What is it? What is the problem?


#3

Write on a few lines in the text.txt file and it should work. :slight_smile:

Also, you are trying to read ("r"), not read and write ("r+")


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.