Skip to content
Snippets Groups Projects
Commit cc09ff6a authored by Lennart Kemmerling's avatar Lennart Kemmerling
Browse files

aufgabe 5 hochgeladen

parent 263eb701
Branches
Tags aufgabe5
No related merge requests found
import csv
cities = []
population = []
csvfile = open('worldcities.csv', encoding="utf8")
reader = csv.DictReader(csvfile,delimiter=";")
for row in reader:
cities.append(row['city'])
population.append(row['population'])
index_max_pop = population.index(max(population))
print ("Anzahl der Stäte in der Datei:",len(cities))
print ("Erste Stadt:",cities[0])
print ("Letzte Stadt:",cities[-1])
print ("Stadt mit den meisten Einwohnern:",cities[index_max_pop])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment