DiYane

Football Cards

Jul 31st, 2023 (edited)
982
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.60 KB | Help | 0 0
  1. team_a = ["A-1", "A-2", "A-3", "A-4", "A-5", "A-6", "A-7", "A-8", "A-9", "A-10", "A-11"]
  2. team_b = ["B-1", "B-2", "B-3", "B-4", "B-5", "B-6", "B-7", "B-8", "B-9", "B-10", "B-11"]
  3.  
  4. game_was_terminated = False
  5.  
  6. sent_off_players = input().split(" ")
  7. for player in sent_off_players:
  8.     if player in team_a:
  9.         team_a.remove(player)
  10.     elif player in team_b:
  11.         team_b.remove(player)
  12.  
  13.     if len(team_a) < 7 or len(team_b) < 7:
  14.         game_was_terminated = True
  15.         break
  16.  
  17. print(f"Team A - {len(team_a)}; Team B - {len(team_b)}")
  18.  
  19. if game_was_terminated:
  20.     print("Game was terminated")
Tags: python
Advertisement
Add Comment
Please, Sign In to add comment