0

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?

khelwood
  • 52,115
  • 13
  • 74
  • 94
K.Bun
  • 1
  • 1

0 Answers0