CSV files are plain text: one row per line, values separated by commas, usually with a header row first. Python's csv module reads them properly, including values that have commas inside quotes.
import csv
with open("expenses.csv", newline="") as f:
rows = list(csv.DictReader(f))
csv.DictReader turns each row into a dictionary keyed by the header, so rows[0]["amount"] is the first row's amount. Every value arrives as text: convert numbers with float() or int() before you add or compare them. The with block closes the file when it ends, so read what you need inside it.
To write a file, open it with "w" and use csv.writer: writer.writerow([...]) writes one row. Pass newline="" to open() whenever you read or write CSV, which keeps line endings right on every system.