Advertisement
LeonardoBelintani

Teste sorteio de grupos

Jul 4th, 2015
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. def sorteiaGrupo(n):
  2.     import random
  3.     Pessoas = ['Iberê', 'Leonardo', 'Marcelo', 'Alex', 'Kauan']
  4.     Grupo_1=[]
  5.     Grupo_2=[]
  6.     while len(Grupo_1) <n:
  7.         Integrante = random.choice(Pessoas)
  8.         Grupo_1.append(Integrante)
  9.         Pessoas.remove(Integrante)
  10.     Grupo_1.sort()
  11.     print ('Grupo 1:', Grupo_1)
  12.     print ('Grupo 2:', Pessoas)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement