Advertisement
Spocoman

03. Football Cards

Jan 22nd, 2022
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. players_off = input().split()
  2. team_a = []
  3. team_b = []
  4. is_break = False
  5. for i in players_off:
  6.     if i[0] == 'A':
  7.         if i not in team_a:
  8.             team_a.append(i)
  9.     elif i[0] == 'B':
  10.         if i not in team_b:
  11.             team_b.append(i)
  12.     if len(team_a) > 4 or len(team_b) > 4:
  13.         is_break = True
  14.         break
  15. print(f'Team A - {11 - len(team_a)}; Team B - {11 - len(team_b)}')
  16. print('Game was terminated' if is_break else '')
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement