Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import choice
- from random import shuffle #for the next assignment
- teamA = []
- teamB = []
- players = ['Alpha', 'Bravo', 'Charlie', 'Delta', 'Echo', 'Foxtrot', 'Golf', 'Hotel', 'India', 'Juliet', 'Kilo', 'Lima', 'Mike', 'November', 'Oscar', 'Papa', 'Qubec', 'Romeo', 'Sierra', 'Tango', 'Uniform', 'Victor', 'Whiskey', 'Xray', 'Yankee', 'Zulu']
- def add_player_to_team(team):
- # Pick a player, add them to the team list and remove from players. someone cut and pasted!!
- player_picked = choice(players)
- team.append(player_picked)
- players.remove(player_picked)
- playersLen = len(players) #How many players?
- loopCount = 0
- for loop in range(playersLen): #stop when you run out of players
- for x in players:
- add_player_to_team(teamA)
- add_player_to_team(teamB)
- print('Team A= ', teamA) #printout the teams
- print('Team B= ', teamB)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement