Allows me to go to the next lesson but I have the following error on the console, and don't see anything being written on the file tab:
Traceback (most recent call last):
File "python", line 3, in
IOError: [Errno 2] No such file or directory: 'output.txt'
Is that a correct way of doing this exercise?
my_list = [i**2 for i in range(1,11)] my_file = open("output.txt", "r+") # Add your code below! for i in my_list: my_file.write(my_list[i].str()) print "\n" my_file.close()