Skip to content

Instantly share code, notes, and snippets.

@ChaitanyaBaweja
Last active March 23, 2020 21:35
Show Gist options
  • Save ChaitanyaBaweja/974129a81752417a865cdcab2193befc to your computer and use it in GitHub Desktop.
Save ChaitanyaBaweja/974129a81752417a865cdcab2193befc to your computer and use it in GitHub Desktop.
# population in millions. (Source: https://www.worldometers.info/world-population/population-by-country/)
population_dict = {'China':1439, 'India':1380, 'USA':331, 'France':65,'Germany':83, 'Spain':46}
# getting user input
Country_Name = input('Please enter Country Name: ')
# access population using country name from dict
print(population_dict[Country_Name])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment