Error

Report a typo

Alice has a file called "books.txt" with all the books that she needs to read for her class. Her professor added another book to the list, so Alice wants to add a new line to the file. Below you can see her code.

However, Alice made a mistake and got a result which was absolutely not what she had expected. Can you fix her mistake?

Don't worry about closing the file here, it will be done under the hood.

Write a program in Python 3
# find a mistake below
file = open('books.txt', 'w', encoding='utf-8')

# closing and other operations are done below
___

Create a free account to access the full topic