Advertisement
ChynaBG

FootballCards2

Feb 1st, 2020
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. cards = input().split()
  2. team_a = [1] * 11
  3. team_b = [1] * 11
  4. for card in cards:
  5.     tokens = card.split('-')
  6.     team = tokens[0]
  7.     player = int(tokens[1])
  8.     player_index = player - 1
  9.  
  10.     if team == 'A':
  11.         team_a[player_index] = 0
  12.     else:
  13.         team_b[player_index] = 0
  14.  
  15. team_a_count = team_a.count(1)
  16. team_b_count = team_b.count(1)
  17.  
  18.  
  19. print(f'Team A - {team_a_count}; Team B - {team_b_count}')
  20. if team_a_count < 7 or team_b_count < 7:
  21.     print('Game was terminated')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement