Advertisement
Guest User

Untitled

a guest
Feb 19th, 2020
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. from random import choice
  2.  
  3. teamA = []
  4. teamB = []
  5. teamC = []
  6.  
  7. players = ["John", "Mark", "Harry", "Jack", "Will", "Joe"]
  8.  
  9. def allocation(team):
  10. player_picked = choice(players)
  11. team.append(player_picked)
  12. players.remove(player_picked)
  13.  
  14. while len(players) > 0:
  15. allocation(teamA)
  16. allocation(teamB)
  17. allocation(teamC)
  18.  
  19. print(teamA)
  20. print(teamB)
  21. print(teamC)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement