Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- UEFA = """Albania
- Andorra
- Armenia
- Austria
- Azerbaijan
- Belarus
- Belgium
- Bosnia-Herzegovina
- Bulgaria
- Croatia
- Cyprus
- Czech Republic
- Denmark
- England
- Estonia
- Faroe Islands
- Finland
- France
- FYR Macedonia
- Georgia
- Germany
- Gibraltar
- Greece
- Hungary
- Iceland
- Israel
- Italy
- Kazakhstan
- Latvia
- Liechtenstein
- Lithuania
- Luxembourg
- Malta
- Moldova
- Montenegro
- Netherlands
- Northern Ireland
- Norway
- Poland
- Portugal
- Republic of Ireland
- Romania
- Russia
- San Marino
- Scotland
- Serbia
- Slovakia
- Slovenia
- Spain
- Sweden
- Turkey
- Switzerland
- Ukraine
- Wales"""
- AFC = """
- Afghanistan
- Australia
- Bahrain
- Bangladesh
- Bhutan
- Brunei Darussalam
- Cambodia
- China PR
- Chinese Taipei
- Guam
- Hong Kong
- India
- Indonesia
- Iran
- Iraq
- Japan
- Jordan
- Korea DPR
- Korea Republic
- Kuwait
- Kyrgyzstan
- Laos
- Lebanon
- Macau
- Malaysia
- Maldives
- Mongolia
- Myanmar
- Nepal
- Northern Mariana Islands
- Oman
- Pakistan
- Palestine
- Philippines
- Qatar
- Saudi Arabia
- Singapore
- Sri Lanka
- Syria
- Tajikistan
- Thailand
- Timor-Leste
- Turkmenista
- United Arab Emirates
- Uzbekistan
- Vietnam
- Yemen"""
- CAF = """ Algeria1
- Angola
- Benin
- Botswana
- Burkina Faso
- Burundi
- Cameroon
- Cape Verde
- Central African Republic
- Chad
- Comoros
- Congo
- Congo DR
- Djibouti
- Egypt
- Equatorial Guinea
- Eritrea
- Ethiopia
- Gabon
- Gambia
- Ghana
- Guinea
- Guinea-Bissau
- Ivory Coast
- Kenya
- Lesotho
- Liberia
- Libya
- Madagascar
- Malawi
- Mali
- Mauritania
- Mauritius
- Morocco
- Mozambique
- Namibia
- Niger
- Nigeria
- Reunion
- Rwanda
- Sao Tome and Príncipe
- Senegal
- Seychelles
- Sierra Leone
- Somalia1
- South Africa
- South Sudan
- Sudan
- Swaziland
- Tanzania
- Togo
- Tunisia
- Uganda
- Zambia
- Zanzibar
- Zimbabwe"""
- CONCACAF = """
- Anguilla
- Antigua and Barbuda
- Aruba
- Bahamas
- Barbados
- Belize
- Bermuda
- Bonaire
- British Virgin Islands
- Canada
- Cayman Islands
- Costa Rica
- Cuba
- Curaçao
- Dominica
- Dominican Republic
- El Salvador
- French Guiana
- Grenada
- Guadeloupe
- Guatemala
- Guyana
- Haiti
- Honduras
- Jamaica
- Martinique
- Mexico
- Montserrat
- Nicaragua
- Panama
- Puerto Rico
- Saint Kitts and Nevis
- Saint Lucia
- Saint-Martin
- Saint Vincent and the Grenadines
- Sint Maarten
- Suriname
- Trinidad and Tobago
- Turks and Caicos Islands
- US Virgin Islands
- USA"""
- CONMEBOL = """
- Argentina
- Bolivia
- Brazil
- Chile
- Colombia
- Ecuador
- Paraguay
- Peru
- Uruguay
- Venezuela"""
- OFC = """
- American Samoa
- Cook Islands
- Fiji
- Kiribati
- New Caledonia
- New Zealand
- Niue
- Papua New Guinea
- Samoa
- Solomon Islands
- Tahiti
- Tonga
- Tuvalu
- Vanuatu"""
- uefaTeams = """
- Albania
- Andorra
- Armenia
- Austria
- Azerbaijan
- Belarus
- Belgium
- Bosnia-Herzegovina
- Bulgaria
- Croatia
- Cyprus
- Czech Republic
- Denmark
- England
- Estonia
- Faroe Islands
- Finland
- France
- FYR Macedonia
- Georgia
- Germany
- Gibraltar
- Greece
- Hungary
- Iceland
- Israel
- Italy
- Kazakhstan
- Latvia
- Liechtenstein
- Lithuania
- Luxembourg
- Malta
- Moldova
- Montenegro
- Netherlands
- Northern Ireland
- Norway
- Poland
- Portugal
- Republic of Ireland
- Romania
- Russia
- San Marino
- Scotland
- Serbia
- Slovakia
- Slovenia
- Spain
- Sweden
- Switzerland
- Ukraine
- Wales"""
- def get_confed_list():
- """Makes a nice list of countries in an input confederation for get_groups() to use, and returns that
- confederation"""
- global UEFA, CONMEBOL, CONCACAF, CAF, AFC, OFC
- confed = ""
- while True:
- confed = input("""Please type in a FIFA confederation with all lowercase letters.
- Valid confederations are uefa, conmebol, concacaf, caf, afc and ofc (case sensitive!):\n""")
- if confed == "uefa" or "conmebol" or "caf" or "afc" or "ofc":
- break
- else:
- print("""Sorry, I didn't quite catch that. Only valid confederations will work.\nValid confederations are uefa, conmebol, concacaf, caf, afc and ofc""")
- continue
- if confed == "uefa":
- confed_str = UEFA
- elif confed == "conmebol":
- confed_str = CONMEBOL
- elif confed == "concacaf":
- confed_str = CONCACAF
- elif confed == "caf":
- confed_str = CAF
- elif confed == "afc":
- confed_str = AFC
- elif confed == "ofc":
- confed_str = OFC
- confed_list = confed_str.splitlines()
- return confed_list
- def get_groups():
- """Constructs and prints all of the groups for a confederation, input when the function runs."""
- confed_set = set(get_confed_list())
- while True:
- group_size = int(input("""Input a group size. It has to be even and positive or else the matching
- wont work further down the line, as this script does not currently support byes.\n"""))
- if group_size & 1 == 0 and group_size > 1:
- # If the group size is even, excecute the rest of the function
- break
- else:
- # If it's odd, prompt for input again
- print("Either what you input wasn't even, or it wasn't positive. Please input again.")
- continue
- for i in range(1, (len(confed_set)//group_size) + 1):
- print("\nGroup {}:".format(i))
- for j in range (0,group_size):
- print(confed_set.pop()) # For some reason it's printing an empty line sometimes
- if len(confed_set) != 0:
- print("\nThe leftovers are:")
- for i in confed_set:
- print(i)
- get_groups()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement