Advertisement
Guest User

Untitled

a guest
Dec 25th, 2023
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.27 KB | None | 0 0
  1. playersA = ["A-1", "A-2", "A-3", "A-4", "A-5", "A-6", "A-7", "A-8", "A-9", "A-10", "A-11"]
  2. playersB = ["B-1", "B-2", "B-3", "B-4", "B-5", "B-6", "B-7", "B-8", "B-9", "B-10", "B-11"]
  3.  
  4. commands = input().split(' ')
  5.  
  6. counterA = 0
  7. counterB = 0
  8.  
  9. new_listA = []
  10. new_listB = []
  11.  
  12. for command in commands:
  13.  
  14.     if new_listA.__contains__(command):
  15.         continue
  16.     elif new_listB.__contains__(command):
  17.         continue
  18.  
  19.     if len(playersA) < 7 or len(playersB) < 7:
  20.         break
  21.  
  22.     if command == "A-1":
  23.         playersA.remove('A-1')
  24.         new_listA.append(command)
  25.         counterA += 1
  26.     elif command == "A-2":
  27.         playersA.remove('A-2')
  28.         new_listA.append(command)
  29.         counterA += 1
  30.     elif command == "A-3":
  31.         playersA.remove('A-3')
  32.         new_listA.append(command)
  33.         counterA += 1
  34.     elif command == "A-4":
  35.         playersA.remove('A-4')
  36.         new_listA.append(command)
  37.         counterA += 1
  38.     elif command == "A-5":
  39.         playersA.remove('A-5')
  40.         new_listA.append(command)
  41.         counterA += 1
  42.     elif command == "A-6":
  43.         playersA.remove('A-6')
  44.         new_listA.append(command)
  45.         counterA += 1
  46.     elif command == "A-7":
  47.         playersA.remove('A-7')
  48.         new_listA.append(command)
  49.         counterA += 1
  50.     elif command == "A-8":
  51.         playersA.remove('A-8')
  52.         new_listA.append(command)
  53.         counterA += 1
  54.     elif command == "A-9":
  55.         playersA.remove('A-9')
  56.         new_listA.append(command)
  57.         counterA += 1
  58.     elif command == "A-10":
  59.         playersA.remove('A-10')
  60.         new_listA.append(command)
  61.         counterA += 1
  62.     elif command == "A-11":
  63.         playersA.remove('A-11')
  64.         new_listA.append(command)
  65.         counterA += 1
  66.  
  67.     elif command == "B-1":
  68.         playersB.remove('B-1')
  69.         new_listB.append(command)
  70.         counterB += 1
  71.     elif command == "B-2":
  72.         playersB.remove('B-2')
  73.         new_listB.append(command)
  74.         counterB += 1
  75.     elif command == "B-3":
  76.         playersB.remove('B-3')
  77.         new_listB.append(command)
  78.         counterB += 1
  79.     elif command == "B-4":
  80.         playersB.remove('B-4')
  81.         new_listB.append(command)
  82.         counterB += 1
  83.     elif command == "B-5":
  84.         playersB.remove('B-5')
  85.         new_listB.append(command)
  86.         counterB += 1
  87.     elif command == "B-6":
  88.         playersB.remove('B-6')
  89.         new_listB.append(command)
  90.         counterB += 1
  91.     elif command == "B-7":
  92.         playersB.remove('B-7')
  93.         new_listB.append(command)
  94.         counterB += 1
  95.     elif command == "B-8":
  96.         playersB.remove('B-8')
  97.         new_listB.append(command)
  98.         counterB += 1
  99.     elif command == "B-9":
  100.         playersB.remove('B-9')
  101.         new_listB.append(command)
  102.         counterB += 1
  103.     elif command == "B-10":
  104.         playersB.remove('B-10')
  105.         new_listB.append(command)
  106.         counterB += 1
  107.     elif command == "B-11":
  108.         playersB.remove('B-11')
  109.         new_listB.append(command)
  110.         counterB += 1
  111.  
  112. team_one = 11 - counterA
  113. team_two = 11 - counterB
  114.  
  115. if team_one < 7 or team_two < 7:
  116.     print(f"Team A - {team_one}; Team B - {team_two}")
  117.     print("Game was terminated")
  118. else:
  119.     print(f"Team A - {team_one}; Team B - {team_two}")
  120.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement