forked from sksalahuddin2828/Python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
32_Countries_King_search_by_country_name.py
47 lines (44 loc) · 1.41 KB
/
32_Countries_King_search_by_country_name.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
countries = {
"Afghanistan": "Taliban",
"Australia": "Scott Morrison",
"Bangladesh": "Sheikh Hasina",
"Bhutan": "Lotay Tshering",
"Canada": "Justin Trudeau",
"Cambodia": "Hun Sen",
"China": "Xi Jinping",
"Denmark": "Mette Frederiksen",
"France": "Emmanuel Macron",
"Germany": "Frank-Walter Steinmeier",
"Japan": "Fumio Kishida",
"Laos": "Thongloun Sisoulith",
"Finland": "Sanna Marin",
"India": "Narendra Modi",
"Indonesia": "Joko Widodo",
"Malaysia": "Gloria Macapagal-Arroyo",
"Nepal": "Ram Chandra Poudel",
"New Zealand": "Jacinda Ardern",
"North Korea": "Kim Jong-Un",
"Norway": "Jonas Gahr Støre",
"Philippines": "Bongbong Marcos",
"Spain": "Pedro Sánchez",
"Singapore": "Halimah Yacob",
"South Korea": "Yoon Suk-Yeol",
"South Africa": "Cyril Ramaphosa",
"Sweden": "Ulf Kristersson",
"Switzerland": "Alain Berset",
"United Kingdom": "Rishi Sunak",
"United States": "Joe Biden",
"Vietnam": "Vo Van Thuong",
"Zambia": "Hakainde Hichilema",
"Zimbabwe": "Emmerson Mnangagwa"
}
search_term = input("Enter a country name: ")
matching_king = None
for country, king in countries.items():
if country.lower() == search_term.lower():
matching_king = king
break
if matching_king:
print(f"The King of {search_term} is {matching_king}.")
else:
print(f"No King found for {search_term}.")