Within my code, I need my Name
and Score
field names to stay the same. However, when adding a row on the last line of code, I want this to append the csv, whereas it's currently overwriting the last entry.
with open("class1.csv", 'w') as csvfile:
fieldnames = ["Name", "Score"]
writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
writer.writeheader()
writer.writerow({'Name': name, 'Score': score})