Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- from random import choice
- players = []
- # I have a text file named 'players' that contains the list of players
- file = open('players', 'r')
- players = file.read().splitlines()
- print(players)
- def Teams(l, n):
- # For item i in a range that is a length of l,
- for i in range(0, len(l), n):
- # Create an index range for l of n items:
- yield (l[i:i+n])
- random.shuffle(players)
- assigned_teams = list(Teams(players,3))
- print(assigned_teams)
- assigned_teams[0]
- 'How many kills total for your team?'
- 'What did you place?'
- #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
- '5-7 = 3 points'
- '2-4 = 5 points'
- 'Victory = 8 points'
- "TeamB what did you place?" 4
- . . .
- . . .
- . . .
- "TeamB your point total is : 27 points"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement