Nessuna descrizione

country_codes.py 309B

12345678910
  1. from pygal.maps.world import COUNTRIES
  2. def get_country_code(country_name):
  3. """Return the Pygal 2-digit country code for the given country."""
  4. for code, name in COUNTRIES.items():
  5. if name == country_name:
  6. return code
  7. # If the country wasn't found, return None.
  8. return None