Python not writing to file

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

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