Created
April 9, 2021 04:30
-
-
Save JayantGoel001/cd994cb2288f39a2e6a45d25a56cc09e to your computer and use it in GitHub Desktop.
Get Information of Any Country using countryinfo python package
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from countryinfo import CountryInfo | |
name = "India" | |
country = CountryInfo(name) | |
print(country.alt_spellings()) | |
print(country.capital()) | |
print(country.currencies()) | |
print(country.languages()) | |
print(country.timezones()) | |
print(country.area()) | |
print(country.borders()) | |
print(country.calling_codes()) | |
print(country.wiki()) | |
print("=======================================================================") | |
name = "Taiwan" | |
country = CountryInfo(name) | |
for key, values in country.info().items(): | |
if type(values) != dict: | |
print(key, "--->", values) | |
else: | |
for vkey, vvalues in values.items(): | |
print("\t", vkey, "--->", vvalues) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment