Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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'
- 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'
- 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'
- 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'
- all_countries = nov2003.split(', ') + dec2013.split(', ') + dec2008.split(', ') + dec2018.split(', ')
- for counter in range(len(all_countries)):
- if all_countries[counter].startswith('the '): #if country name starts with "the ", remove it
- all_countries[counter] = all_countries[counter][4:] #remove "the "
- all_countries = set(all_countries) #remove duplicate names
- all_countries = list(all_countries)
- all_countries.sort()
- print(all_countries)
- >>['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']
- print('The number of countries are ', len(all_countries) + 1)
- >>The number of countries are 61
- #I had to change the name of some in Tim's list, Syria was listed as "Syrian Arab Republic" in the UN Docs
- 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'
- tim_countries = tim_countries.split(', ')
- print("The number of Tim's countries are ", len(tim_countries) + 1)
- >>The number of Tim's countries are 70
- for c in tim_countries:
- if c not in all_countries:
- print(c)
- >Iran
- >Kuwait
- >Kyrgyzstan
- >Nepal
- >Peru
- >South Africa
- >Macedonia
- >South Korea
- >Turkmenistan
- >Uzbekistan
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement