Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import choice
- teamA = []
- teamB = [] # Create two empty lists for teams A and B
- players = ['Harry', 'Isabel', 'Jack', 'Ginny']
- def add_player_to_team(team):
- player_picked = choice(players)
- team.append(player_picked)
- players.remove(player_picked)
- while len(players):
- # Add a player to each team
- add_player_to_team(teamA)
- add_player_to_team(teamB)
- print("teamA: ",(teamA))
- print("teamB: ",(teamB))
Advertisement
Add Comment
Please, Sign In to add comment