Advertisement
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', 'Hermione', 'Neville', 'Ginny']
- pool= int(len(players)/2)
- print (pool)
- def add_player_to_team(team):
- for i in range(0,pool):
- player_picked = choice(players)
- team.append(player_picked)
- players.remove(player_picked)
- # Add a player to each team
- add_player_to_team(teamA)
- add_player_to_team(teamB)
- print (teamA)
- print (teamB)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement