Advertisement
g0thy

LIST3A

Dec 10th, 2019
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.86 KB | None | 0 0
  1. #from random import choice
  2. from random import shuffle
  3. from random import sample
  4.  
  5. teamA = []
  6. teamB = []
  7.  
  8. 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']
  9.  
  10. def add_players_to_team():  
  11.     players_picked = sample(players, int(playersLen/2))
  12.     teamA.append(players_picked)
  13.    
  14.    
  15. def removeTeamA():      #THINK THIS BIT IS WRONG - TRIED DIFFERENT THINGS BUT STILL WILL NOT WORK
  16.     lenA = len(teamA)
  17.     for item in teamA:
  18.         players.remove(item)
  19.        
  20.     teamB.append(players)
  21.    
  22.  
  23.  
  24. playersLen = len(players) #How many players?
  25. add_players_to_team()
  26. removeTeamA()
  27.    
  28. print('Team A= ', teamA)    #printout the teams
  29. print('Team B= ', teamB)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement