Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import randint
- count, teams, ans = map(int, input('Введите количество игроков, количество команд, и "1", если нужны имена;"0", если имена не нужны.\n').split())
- if ans == 1:
- players = []
- for i in range(count):
- players.append(input())
- a = []
- for i in range(teams):
- a.append([])
- for i in range(len(players)):
- a[i % teams].append(players.pop(randint(0,len(players) - 1)))
- for i in a:
- print(*i)
- else:
- players = [i for i in range(1,count + 1)]
- a = []
- for i in range(teams):
- a.append([])
- for i in range(len(players)):
- a[i % teams].append(players.pop(randint(0,len(players) - 1)))
- for i in a:
- print(*i)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement