Skip to content

Commit

Permalink
Create football_cards
Browse files Browse the repository at this point in the history
  • Loading branch information
MLambev authored Aug 3, 2023
1 parent de387c0 commit 4cb9b76
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions lists_basics_exercise/football_cards
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
team_a = ["A-1", "A-2", "A-3", "A-4", "A-5", "A-6", "A-7", "A-8", "A-9", "A-10", "A-11"]
team_b = ["B-1", "B-2", "B-3", "B-4", "B-5", "B-6", "B-7", "B-8", "B-9", "B-10", "B-11"]

players_with_card = input().split()
game_was_terminated = False

for player in players_with_card:

if player in team_a:
team_a.remove(player)
elif player in team_b:
team_b.remove(player)

if len(team_a) < 7 or len(team_b) < 7:
game_was_terminated = True
break

print(f"Team A - {len(team_a)}; Team B - {len(team_b)}")

if game_was_terminated == True:
print("Game was terminated")

0 comments on commit 4cb9b76

Please sign in to comment.