It Gives the following error message:
Oops, try again. It looks like your file doesn't contain each element from my_list on its own line.
I expected to print each element from my_list on its own line.
my_list = [i**2 for i in range(1,11)] my_file = open("output.txt", "r+") # Add your code below! for item in my_list: my_file.write(str(i) + '\n') my_file.close()
I can't Figure Out My Mistake!