BdW44222

03. Football Cards

Jun 6th, 2021
713
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. team_a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
  2. team_b = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
  3. players_input = input().split()
  4.  
  5. is_terminated = False
  6.  
  7.  
  8. for player in players_input:
  9.     card_info = player.split("-")
  10.     player_team = card_info[0]
  11.     player_number = int(card_info[1])
  12.  
  13.     if player_team == 'A' and player_number in team_a:
  14.         team_a.remove(player_number)
  15.     elif player_team == 'B' and player_number in team_b:
  16.         team_b.remove(player_number)
  17.     if len(team_a) < 7 or len(team_b) < 7:
  18.         is_terminated = True
  19.  
  20.  
  21. print(f'Team A - {len(team_a)}; Team B - {len(team_b)}')
  22. if is_terminated:
  23.     print('Game was terminated')
  24.  
RAW Paste Data