timpin

Untitled

Aug 28th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. from random import choice
  2.  
  3. teamA = []
  4. teamB = [] # Create two empty lists for teams A and B
  5.  
  6. players = ['Harry', 'Isabel', 'Jack', 'Ginny']
  7.  
  8.  
  9. def add_player_to_team(team):
  10. player_picked = choice(players)
  11. team.append(player_picked)
  12. players.remove(player_picked)
  13.  
  14. while len(players):
  15. # Add a player to each team
  16. add_player_to_team(teamA)
  17. add_player_to_team(teamB)
  18.  
  19. print("teamA: ",(teamA))
  20. print("teamB: ",(teamB))
Advertisement
Add Comment
Please, Sign In to add comment