Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- players = ['Harry','Ginny','Neville', 'Hermione', 'Ghost']
- #players = ['Harry','Ginny','Neville', 'Hermione']
- #players = ['Harry','Ginny']
- #players = ['Harry']
- #players = [ ]
- #print(players)
- teamA = [ ]
- teamB = [ ]
- def team_selection():
- while len(players) > 0:
- playerA = choice(players)
- #print(playerA)
- teamA.append(playerA)
- players.remove(playerA)
- #print('Players left: ', players)
- if players == [ ]:
- break
- playerB = choice(players)
- #print(playerB)
- teamB.append(playerB)
- players.remove(playerB)
- #print('Players left: ', players)
- team_selection()
- print(teamA)
- print(teamB)
Advertisement
Add Comment
Please, Sign In to add comment