Write data to files, overwriting or appending.
Source Code
with open("output.txt", "w") as file: # Overwrites the file
file.write("New contentn")
with open("output.txt", "a") as file: # Appends to the file
file.write("Additional contentn")