Page 1 of 1

Python: Appending a File

Posted: Wed Aug 20, 2025 11:58 am
by The Jason

Code: Select all

with open("school_grades.txt", "a") as school_,grades_dot_txt:

school_grades_dot_txt.write("Amber: Grade = 3.8")

# This adds Amber's grade to the file. It doesn't erase what was on it before.