Advertisement
Guest User

Holodomor Countries

a guest
May 30th, 2021
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.13 KB | None | 0 0
  1. nov2003 = 'Azerbaijan, Bangladesh, Belarus, Benin, Bosnia and Herzegovina, Canada, Egypt, Georgia, Guatemala, Jamaica, Kazakhstan, Mongolia, Nauru, Pakistan, Qatar, Moldova, the Russian Federation, Saudi Arabia, the Sudan, Syria, Tajikistan, Timor-Leste, Ukraine, the United Arab Emirates, the United States of America'
  2. dec2013 = 'Albania, Australia, Austria, Azerbaijan, Belgium, Canada, Croatia, the Czech Republic, Denmark, Estonia, Finland, France, Georgia, Germany, Hungary, Iceland, Ireland, Israel, Latvia, Liechtenstein, Lithuania, Luxembourg, Malta, Moldova, Monaco, Norway, Poland, Spain, Sweden, Ukraine, the United Kingdom of Great Britain and Northern Ireland, the United States of America'
  3. dec2008 = 'Albania, Australia, Austria, Azerbaijan, Belgium, Canada, Croatia, the Czech Republic, Denmark, Estonia, Finland, France, Georgia, Germany, Hungary, Iceland, Ireland, Israel, Latvia, Liechtenstein, Lithuania, Luxembourg, Malta, Monaco, Norway, Poland, Saint Lucia, Spain, Sweden, Ukraine, the United Kingdom of Great Britain and Northern Ireland, the United States of America'
  4. dec2018 = 'Albania, Australia, Austria, Azerbaijan, Belgium, Bulgaria, Canada, Chile, Croatia, the Czech Republic, Denmark, Estonia, Finland, France, Georgia, Germany, Hungary, Iceland, Ireland, Israel, Latvia, Liechtenstein, Lithuania, Luxembourg, Moldova, Monaco, Montenegro, the Netherlands, Norway, Poland, Portugal, Slovenia, Spain, Sweden, Switzerland, Ukraine, the United Kingdom of Great Britain and Northern Ireland, the United States of America'
  5. nov2003add = 'Argentina, Iran, Kuwait, Kyrgyzstan, Nepal, Peru, South Korea, South Africa, Macedonia, Turkmenistan, Uzbekistan'
  6.  
  7. all_countries = nov2003.split(', ') + dec2013.split(', ') + dec2008.split(', ') + dec2018.split(', ') + nov2003add.split(', ')
  8. for counter in range(len(all_countries)):
  9.     if all_countries[counter].startswith('the '): #if country name starts with "the ", remove it
  10.         all_countries[counter] = all_countries[counter][4:] #remove "the "
  11.  
  12.  
  13. all_countries = set(all_countries)  #remove duplicate names
  14. all_countries = list(all_countries)
  15. all_countries.sort()
  16. print(all_countries)
  17. print('The number of countries are ', len(all_countries))
  18.  
  19. >['Albania', 'Argentina', 'Australia', 'Austria', 'Azerbaijan', 'Bangladesh', 'Belarus', 'Belgium', 'Benin', 'Bosnia and Herzegovina', 'Bulgaria', 'Canada', 'Chile', 'Croatia', 'Czech Republic', 'Denmark', 'Egypt', 'Estonia', 'Finland', 'France', 'Georgia', 'Germany', 'Guatemala', 'Hungary', 'Iceland', 'Iran', 'Ireland', 'Israel', 'Jamaica', 'Kazakhstan', 'Kuwait', 'Kyrgyzstan', 'Latvia', 'Liechtenstein', 'Lithuania', 'Luxembourg', 'Macedonia', 'Malta', 'Moldova', 'Monaco', 'Mongolia', 'Montenegro', 'Nauru', 'Nepal', 'Netherlands', 'Norway', 'Pakistan', 'Peru', 'Poland', 'Portugal', 'Qatar', 'Russian Federation', 'Saint Lucia', 'Saudi Arabia', 'Slovenia', 'South Africa', 'South Korea', 'Spain', 'Sudan', 'Sweden', 'Switzerland', 'Syrian Arab Republic', 'Tajikistan', 'Timor-Leste', 'Turkmenistan', 'Ukraine', 'United Arab Emirates', 'United Kingdom of Great Britain and Northern Ireland', 'United States of America', 'Uzbekistan']
  20. >The number of countries are  70
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement