Writing Error- I don't get it



I don't really get the error in this script. The error is 'Oops, try again. It looks like your file doesn't contain each element from my_list on its own line.' Please help somebody! Thanks in advance!

my_list = [i**2 for i in range(1,11)]

my_file = open("output.txt", "r+")

for i in my_list:


Writing some formatted text should help...

"%s\n" % i

Note that we include the newline escape sequence.


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