-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathteht16.py
More file actions
13 lines (13 loc) · 736 Bytes
/
Copy pathteht16.py
File metadata and controls
13 lines (13 loc) · 736 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/python
#coding=UTF-8
countrycodes=['fi','se','no'];#Maakoodit
codemap={'fi':'Finland','se':'Sweden','no':'Norway'};#Maiden nimet, indeksinä maakoodi
countries={#Maiden tiedot, indeksinä maan nimi
'Finland':{'head honcho':('Juha Sipilä',54),'population':5.439},
'Sweden':{'head honcho':('Stefan Lofven',58),'population':9.593},
'Norway':{'head honcho':('Erna Solberg',54),'population':5.084}
};
for koodi in countrycodes:#Käydään maakoodilista läpi
maa=codemap[koodi];#Tallennetaan maan nimi muuttujaan
#Tulostetaan maan tiedot
print maa,":\n\thead honcho: ",countries[maa]['head honcho'][0],", who is ",countries[maa]['head honcho'][1]," years old\n\tpopulation: ",countries[maa]['population']," million";