Python not writing to file
LordTopley

So, I'm learning from scratch and I've just begun with Writing to files.

Here is my code:

my_file = open('out.txt', 'w')
my_file.write('Hello World')

I see the out.txt is created, but nothing is written to the file

You are viewing a single comment. View All
gozie11

@LordTopley I was having the same problem just because i forgot the parentheses at the end of file.close()