feat: Initial commit
This commit is contained in:
22
Laboratorio11/nazioniPIL.py
Normal file
22
Laboratorio11/nazioniPIL.py
Normal file
@@ -0,0 +1,22 @@
|
||||
import csv
|
||||
|
||||
with open("export.csv") as csv_file:
|
||||
csv_reader = csv.reader(csv_file)
|
||||
|
||||
line_count = 0
|
||||
|
||||
nations = {}
|
||||
|
||||
for row in csv_reader:
|
||||
if line_count == 0:
|
||||
print(f'Column names are {", ".join(row)}')
|
||||
line_count += 1
|
||||
else:
|
||||
nations[row[0]] = row[2]
|
||||
|
||||
while True:
|
||||
uinput = input("Inserisci il nome della nazione o quit: ")
|
||||
if uinput == "quit":
|
||||
break
|
||||
|
||||
print(nations[uinput])
|
||||
Reference in New Issue
Block a user