Perfect! As we noted in Part 1, there is no standard for what delimiter a CSV must use, even though the name suggests that commas are the most popular option.
Fortunately, you can specify optional parameters for both
csv.DictReader(), the most useful of which is
delimiter. Take a look:
with open('departments_semicolons.csv') as csv_file:
csv_reader = csv.DictReader(csv_file, delimiter=';')
We introduced an optional
delimiter parameter that equals the semicolon character. This means we expect the CSV file to use semicolons rather than commas to separate its fields.