Advertisement
Fareehausman00

Untitled

Sep 21st, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #splitting players into teams
  2.  
  3. from random import *
  4. teamA = []
  5. teamB = []
  6.  
  7. players = ['Ginny', 'Neville', 'Harry', 'Hermione']
  8. split = int(len(players)/2)
  9.  
  10. def team_players(teams):
  11. for i in range(0, split):
  12. player_picked = choice(players)
  13. teams.append(player_picked)
  14. players.remove(player_picked)
  15.  
  16.  
  17. team_players(teamA)
  18. team_players(teamB)
  19. print(teamA)
  20. print (teamB)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement