''' Fetch data of any Country with Python using Countryinfo Author: Ayushi Rawat ''' #import the necessary module! from countryinfo import CountryInfo name = 'India' country = CountryInfo(name) data1 = country.alt_spellings() print(data1) data2 = country.capital() print(data2) data3 = country.currencies() print(data3) data4 = country.languages() print(data4) data5 = country.timezones() print(data5) data6 = country.area() print(data6) data7 = country.borders() print(data7)
# pip install countryinfo # pip install qrcode[pil] # pip install folium import qrcode import folium from countryinfo import CountryInfo print('Welcome, You can get information about any country here!') user = input('\nEnter the name of a country:\n') name = user country = CountryInfo(name) country_name = country.alt_spellings() print('\nName:') for name in country_name: print(name, end=', ') country_capital = country.capital() print(f'\n\nCapital:\n{country_capital}') country_currency = country.currencies() print('\nCurrency:') for currency in country_currency: print(currency, end=', ') country_lang = country.languages() print('\n\nLanguages:') for languages in country_lang: print(languages, end=', ')