I am stuck with this code. Can you please help me?
it looks like the file doesn't contain each element from my_list on its own line
why this is not working?
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("%s\n" % (item)) my_file.close()