Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. import random
  2. from random import choice
  3.  
  4. players = []
  5. # I have a text file named 'players' that contains the list of players
  6. file = open('players', 'r')
  7. players = file.read().splitlines()
  8. print(players)
  9.  
  10. def Teams(l, n):
  11. # For item i in a range that is a length of l,
  12. for i in range(0, len(l), n):
  13. # Create an index range for l of n items:
  14. yield (l[i:i+n])
  15.  
  16. random.shuffle(players)
  17. assigned_teams = list(Teams(players,3))
  18. print(assigned_teams)
  19.  
  20. assigned_teams[0]
  21.  
  22.  
  23. 'How many kills total for your team?'
  24. 'What did you place?'
  25.  
  26. #I know I need to turn this into a if, elif statement but don't know how to create an overall loop to do this sequence of questions for each team
  27.  
  28. '5-7 = 3 points'
  29. '2-4 = 5 points'
  30. 'Victory = 8 points'
  31.  
  32. "TeamB what did you place?" 4
  33. . . .
  34. . . .
  35. . . .
  36. "TeamB your point total is : 27 points"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement