Gives me the following error message:
Traceback (most recent call last):
File "python", line 1, in
IOError: [Errno 2] No such file or directory: 'text.txt'
The error is in line 1 which is defined as per the instructions... I expect no error in the code... can someone please explain why the error pops up?
Thanks in advance!
my_file = open("text.txt", "r") for i in range(1,3): print my_file.readline() my_file.close()