Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.

Well done!

You have completed (UPI) Chapter 16: Working with Files in Python!

Instruction

Using write() and close()

The write() function is used to write to an already opened file. The write() function will only accept a string parameter. Other variable types must be cast to string before writing using write().

The write() function does not automatically add a newline character as the print() function does. A newline must be added explicitly by adding a newline ('\n') character.

The `write(...