Advertisement
Guest User

Untitled

a guest
Apr 24th, 2015
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.93 KB | None | 0 0
  1. UEFA = """Albania
  2. Andorra
  3. Armenia
  4. Austria
  5. Azerbaijan
  6. Belarus
  7. Belgium
  8. Bosnia-Herzegovina
  9. Bulgaria
  10. Croatia
  11. Cyprus
  12. Czech Republic
  13. Denmark
  14. England
  15. Estonia
  16. Faroe Islands
  17. Finland
  18. France
  19. FYR Macedonia
  20. Georgia
  21. Germany
  22. Gibraltar
  23. Greece
  24. Hungary
  25. Iceland
  26. Israel
  27. Italy
  28. Kazakhstan
  29. Latvia
  30. Liechtenstein
  31. Lithuania
  32. Luxembourg
  33. Malta
  34. Moldova
  35. Montenegro
  36. Netherlands
  37. Northern Ireland
  38. Norway
  39. Poland
  40. Portugal
  41. Republic of Ireland
  42. Romania
  43. Russia
  44. San Marino
  45. Scotland
  46. Serbia
  47. Slovakia
  48. Slovenia
  49. Spain
  50. Sweden
  51. Turkey
  52. Switzerland
  53. Ukraine
  54. Wales"""
  55.  
  56. AFC = """
  57. Afghanistan
  58. Australia
  59. Bahrain
  60. Bangladesh
  61. Bhutan
  62. Brunei Darussalam
  63. Cambodia
  64. China PR
  65. Chinese Taipei
  66. Guam
  67. Hong Kong
  68. India
  69. Indonesia
  70. Iran
  71. Iraq
  72. Japan
  73. Jordan
  74. Korea DPR
  75. Korea Republic
  76. Kuwait
  77. Kyrgyzstan
  78. Laos
  79. Lebanon
  80. Macau
  81. Malaysia
  82. Maldives
  83. Mongolia
  84. Myanmar
  85. Nepal
  86. Northern Mariana Islands
  87. Oman
  88. Pakistan
  89. Palestine
  90. Philippines
  91. Qatar
  92. Saudi Arabia
  93. Singapore
  94. Sri Lanka
  95. Syria
  96. Tajikistan
  97. Thailand
  98. Timor-Leste
  99. Turkmenista
  100. United Arab Emirates
  101. Uzbekistan
  102. Vietnam
  103. Yemen"""
  104.  
  105. CAF = """ Algeria1
  106. Angola
  107. Benin
  108. Botswana
  109. Burkina Faso
  110. Burundi
  111. Cameroon
  112. Cape Verde
  113. Central African Republic
  114. Chad
  115. Comoros
  116. Congo
  117. Congo DR
  118. Djibouti
  119. Egypt
  120. Equatorial Guinea
  121. Eritrea
  122. Ethiopia
  123. Gabon
  124. Gambia
  125. Ghana
  126. Guinea
  127. Guinea-Bissau
  128. Ivory Coast
  129. Kenya
  130. Lesotho
  131. Liberia
  132. Libya
  133. Madagascar
  134. Malawi
  135. Mali
  136. Mauritania
  137. Mauritius
  138. Morocco
  139. Mozambique
  140. Namibia
  141. Niger
  142. Nigeria
  143. Reunion
  144. Rwanda
  145. Sao Tome and Príncipe
  146. Senegal
  147. Seychelles
  148. Sierra Leone
  149. Somalia1
  150. South Africa
  151. South Sudan
  152. Sudan
  153. Swaziland
  154. Tanzania
  155. Togo
  156. Tunisia
  157. Uganda
  158. Zambia
  159. Zanzibar
  160. Zimbabwe"""
  161.  
  162. CONCACAF = """
  163. Anguilla
  164. Antigua and Barbuda
  165. Aruba
  166. Bahamas
  167. Barbados
  168. Belize
  169. Bermuda
  170. Bonaire
  171. British Virgin Islands
  172. Canada
  173. Cayman Islands
  174. Costa Rica
  175. Cuba
  176. Curaçao
  177. Dominica
  178. Dominican Republic
  179. El Salvador
  180. French Guiana
  181. Grenada
  182. Guadeloupe
  183. Guatemala
  184. Guyana
  185. Haiti
  186. Honduras
  187. Jamaica
  188. Martinique
  189. Mexico
  190. Montserrat
  191. Nicaragua
  192. Panama
  193. Puerto Rico
  194. Saint Kitts and Nevis
  195. Saint Lucia
  196. Saint-Martin
  197. Saint Vincent and the Grenadines
  198. Sint Maarten
  199. Suriname
  200. Trinidad and Tobago
  201. Turks and Caicos Islands
  202. US Virgin Islands
  203. USA"""
  204.  
  205. CONMEBOL = """
  206. Argentina
  207. Bolivia
  208. Brazil
  209. Chile
  210. Colombia
  211. Ecuador
  212. Paraguay
  213. Peru
  214. Uruguay
  215. Venezuela"""
  216.  
  217. OFC = """
  218. American Samoa
  219. Cook Islands
  220. Fiji
  221. Kiribati
  222. New Caledonia
  223. New Zealand
  224. Niue
  225. Papua New Guinea
  226. Samoa
  227. Solomon Islands
  228. Tahiti
  229. Tonga
  230. Tuvalu
  231. Vanuatu"""
  232.  
  233. uefaTeams = """
  234. Albania
  235. Andorra
  236. Armenia
  237. Austria
  238. Azerbaijan
  239. Belarus
  240. Belgium
  241. Bosnia-Herzegovina
  242. Bulgaria
  243. Croatia
  244. Cyprus
  245. Czech Republic
  246. Denmark
  247. England
  248. Estonia
  249. Faroe Islands
  250. Finland
  251. France
  252. FYR Macedonia
  253. Georgia
  254. Germany
  255. Gibraltar
  256. Greece
  257. Hungary
  258. Iceland
  259. Israel
  260. Italy
  261. Kazakhstan
  262. Latvia
  263. Liechtenstein
  264. Lithuania
  265. Luxembourg
  266. Malta
  267. Moldova
  268. Montenegro
  269. Netherlands
  270. Northern Ireland
  271. Norway
  272. Poland
  273. Portugal
  274. Republic of Ireland
  275. Romania
  276. Russia
  277. San Marino
  278. Scotland
  279. Serbia
  280. Slovakia
  281. Slovenia
  282. Spain
  283. Sweden
  284. Switzerland
  285. Ukraine
  286. Wales"""
  287.  
  288. def get_confed_list():
  289. """Makes a nice list of countries in an input confederation for get_groups() to use, and returns that
  290. confederation"""
  291. global UEFA, CONMEBOL, CONCACAF, CAF, AFC, OFC
  292. confed = ""
  293. while True:
  294. confed = input("""Please type in a FIFA confederation with all lowercase letters.
  295. Valid confederations are uefa, conmebol, concacaf, caf, afc and ofc (case sensitive!):\n""")
  296. if confed == "uefa" or "conmebol" or "caf" or "afc" or "ofc":
  297. break
  298. else:
  299. print("""Sorry, I didn't quite catch that. Only valid confederations will work.\nValid confederations are uefa, conmebol, concacaf, caf, afc and ofc""")
  300. continue
  301.  
  302. if confed == "uefa":
  303. confed_str = UEFA
  304. elif confed == "conmebol":
  305. confed_str = CONMEBOL
  306. elif confed == "concacaf":
  307. confed_str = CONCACAF
  308. elif confed == "caf":
  309. confed_str = CAF
  310. elif confed == "afc":
  311. confed_str = AFC
  312. elif confed == "ofc":
  313. confed_str = OFC
  314.  
  315. confed_list = confed_str.splitlines()
  316. return confed_list
  317.  
  318. def get_groups():
  319. """Constructs and prints all of the groups for a confederation, input when the function runs."""
  320. confed_set = set(get_confed_list())
  321. while True:
  322. group_size = int(input("""Input a group size. It has to be even and positive or else the matching
  323. wont work further down the line, as this script does not currently support byes.\n"""))
  324. if group_size & 1 == 0 and group_size > 1:
  325. # If the group size is even, excecute the rest of the function
  326. break
  327. else:
  328. # If it's odd, prompt for input again
  329. print("Either what you input wasn't even, or it wasn't positive. Please input again.")
  330. continue
  331. for i in range(1, (len(confed_set)//group_size) + 1):
  332. print("\nGroup {}:".format(i))
  333. for j in range (0,group_size):
  334. print(confed_set.pop()) # For some reason it's printing an empty line sometimes
  335.  
  336. if len(confed_set) != 0:
  337. print("\nThe leftovers are:")
  338. for i in confed_set:
  339. print(i)
  340.  
  341. get_groups()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement