So far I have got this:
file=open(" The portal","w")
file.write(input("text to be written in the file: "))
file.close()
However I am required to have an exit option (on python), to close the file. I've tried exit()
, but that closes python not the file. Any ideas?