Advertisement
Guest User

Holodomor Countries

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