Advertisement
ChynaBG

FootballCards1

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