Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. from random import shuffle
  2.  
  3. teamA=[]
  4. teamB=[]
  5. players=["Chiara", "Alessandra", "Giovanna", "Giulia", "Benedetta", "Livia", "Alberta", "Maria"]
  6.  
  7. def add_player_to_team(team):
  8. team_players=0
  9. while team_players <4:
  10. shuffle(players)
  11. player_picked = players.pop()
  12. team.append(player_picked)
  13. team_players=team_players+1
  14.  
  15.  
  16. add_player_to_team(teamA)
  17. add_player_to_team(teamB)
  18.  
  19. print("Team A:")
  20. for player_picked in teamA:
  21. print(player_picked)
  22. print(" ")
  23. print("Team B:")
  24. for player_picked in teamB:
  25. print(player_picked)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement