Python: Appending a File

Post Reply
User avatar
Jason
Site Admin
Posts: 767
Joined: Sun Dec 21, 2025 8:56 pm

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.

 

POSTREACT(ions) SUMMARY

Post Reply