Please enable JavaScript to use CodeHS

Utah Introduction to Python 1 and 2

Lesson 17.1 Write to End of File

Description

In this lesson, students learn how to write to existing files. They will explore two modes: “w” for overwriting a file and “a” for appending to a file.


Objective

Students will be able to:

  • Understand the purpose and importance of writing to files in programming
  • Use the “w” mode to overwrite the contents of a file
  • Use the “a” mode to append new data to the end of a file