-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathcities.py
29 lines (27 loc) · 818 Bytes
/
cities.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Author: Bojan G. Kalicanin
# Date: 29-Sep-2016
# Make a dictonary of cities with their information
cities = {
'belgrade': {
'country': 'serbia',
'population': 2000000,
'description': 'capital of serbia',
},
'london': {
'country': 'england',
'population': 8000000,
'description': 'capital of the uk',
},
'new york': {
'country': 'united states',
'population': 10000000,
'description': 'biggest city of the us'
},
}
for city, info in cities.items():
print("\nSome facts about the " + city.title() + ":")
for key, value in info.items():
if key == 'population':
print("\t" + key.title() + ": " + str(value))
else:
print("\t" + key.title() + ": " + value.title())