Write the python program using only the import CSV to display the following:
https://drive.google.com/file/d/1OnN0RCvpVJ3A4x02DAOxWNSxJwJmJfm9/view?usp=sharing
NOTE:
DON'T USE ANY DIFFERENT MODULE, JUST IMPORT CSV
import csv
with open('data.csv', newline='') as csvfile:
reader = csv.DictReader(csvfile)
city = ''
for row in reader:
count = 0
if city != row:
city = row
for i in reader:
if city == i['country']:
count=count+1
print(city, ':', count)
Comments
Leave a comment