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']
- def add_player_to_team(team):
- for player in players:
- player_picked = choice(players)
- team.append(player_picked)
- players.remove(player_picked)
- print(team)
- # Add a player to each team
- print("Players in Team_A")
- add_player_to_team(teamA)
- print("\nPlayers in Team_B")
- add_player_to_team(teamB)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement