Whats going wrong here


#1

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

i=1
while len(my_file.readline(i))!=0:
print my_file.readline(i)
i+=1
my_file.close()

Traceback (most recent call last):
File "python", line 1, in
IOError: [Errno 2] No such file or directory: 'text.txt'


#2

This seems to be a bug with that lesson. You can see a couple of different workaround solutions here: