Reading Between the lines


It tells me to refresh the page.

my_file = open("text.txt", "r")

print my_file.readline(1)
print my_file.readline(2)
print my_file.readline(3)


  1. Refresh the page
  2. Go to text.txt tab
  3. Add anything to the end of all lines
  4. Run your code

Hope this helps :slight_smile:


Thank you. Fixed it right away.
Modify some letters in tab "text.txt" worked for me.


No need for the line number in .readline().
seems to return chunks of the first line.
I if someone could explain how works it would be appreciate it a lot.


Thanks very much! Made it work straight away!


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


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