Writing, succeeded with code, but output.txt is empty


The code I wrote here below works, as in I got the green light.
But, when I look at the output.txt tab, it's empty. So it didn't write anything to it.

What's going on?

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:


never mind, it worked after i tried again.


I think the file section doesn't work really good on CC

Install python on your computer and try it there


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