This is my code, which passes, but nothing gets printed and this is the error message I get:
Traceback (most recent call last):
File "python", line 3, in
IOError: [Errno 2] No such file or directory: 'output.txt'
my_list = [i**2 for i in range(1,11)] my_file = open("output.txt", "r+") for i in my_list: my_file.write(str("i\n")) my_file.close()