Rainbow Deals - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
The very basics of text files
5. Appending to a file
with statement and exception handling
Summary

## Instruction

Perfect! Now, let's see how the 'a' (append) mode works. As we said before, it is used to add new information to the end of a file without overwriting its existing contents:

file = open('employees.txt', 'a')
file.write('\nKate Smith, Junior Python Developer')
file.close()

By using the 'a' mode in the open() function, we could add a new employee to our list instead of deleting all the other employees. Note that we started with '\n', which is a newline character.

## Exercise

Open the daily_sales.txt file in the append mode. Add the following three lines at the end of the file:

Day 8 (Monday): 19432.19
Day 9 (Tuesday): 18233.76
Day 10 (Wednesday): 23432.43


### Stuck? Here's a hint!

file = open('daily_sales.txt', 'a')
Remember about using \n to introduce new lines.