Python: Writing a File

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

Code: Select all

with open("school_grades.txt", "w") as school_grades_dot_txt:

school_grades_dot_txt.write("Larry: Grade = 3.5")
 
# The code above erased and replaced whatever was on the file.
 

POSTREACT(ions) SUMMARY

Post Reply