Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Writing CSV files


Good job! You can also provide additional parameters to csv.writer or csv.DictWriter and specify your own delimiter, quote character, or quoting style. For example:

with open('books.csv', mode='w', newline='') as csv_file:
  csv_writer = csv.DictWriter(csv_file, fieldnames=['Author', 'Title', 'Pages'], delimiter=';')
  for row in data_to_save:

On line 2, we added an optional parameter: delimiter=';'. As a result, our DictWriter will use semicolons to separate fields.


Modify the template code so that it uses a semicolon as its delimiter.

Stuck? Here's a hint!

Add an optional delimiter parameter inside the csv.writer() function.