-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCountries_Details.py
More file actions
31 lines (27 loc) · 1.45 KB
/
Countries_Details.py
File metadata and controls
31 lines (27 loc) · 1.45 KB
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
from countryinfo import CountryInfo
try:
count = input('Enter the name of the country or -1 to quit: ')
while count != '-1':
country = CountryInfo(count)
print("Capital is: ", country.capital())
print('----------------------------------------------------------------')
print('Currency is: ', country.currencies())
print('----------------------------------------------------------------')
print('Language is: ', country.languages())
print('----------------------------------------------------------------')
print('Borders are: ', country.borders())
print('----------------------------------------------------------------')
print('Other names are: ', country.alt_spellings())
print('----------------------------------------------------------------')
print('Population is: ', country.population())
print('----------------------------------------------------------------')
print('Time zone is: ',country.timezones())
print('----------------------------------------------------------------')
count = input('Enter the name of the country or -1 to quit: ')
print('----------------------------------------------------------------')
else:
print('Thanks for using the program...')
except KeyError:
print('Country was not found!')
print('Try Again with a valid country name.')
# Author - Mmabiaa