Galera alguém pode dar um help no código? Estou querendo que os grupos digitados sejam distribuidos aleatoriamentes na listas A,B,C,D. Mas quando executo algumas lista ficam faltando dados. PYTHON
import random
A = []
B = []
C = []
D = []
c1 = []
c2 = []
S2 = []
b = 0
for k in range(12):
nome = input('Digite seu nome: ')
idade = int(input('Sua idade: '))
serie = int(input('Qual sua serie?: '))
if serie == 1 or serie == 2 or serie == 3:
c2.append(2)
if serie == 1:
c1.append(1)
print('')
dados = (f'Nome: {nome} Idade: {int(idade)} Serie: {int(serie)}')
lista = random.choice([A, B, C, D])
lista2 = random.choice([B])
lista3 = random.choice([C, D])
lista4 = random.shuffle([D])
if lista == A and len(A) < 3 and dados not in A:
b = random.randint(0, 11)
A.append(f'Nome: {nome} Idade: {int(idade)} Serie: {int(serie)}')
if lista == B and len(B) < 3 and dados not in A and dados not in B and dados not in C:
b = random.randint(0, 11)
B.append(f'Nome: {nome} Idade: {int(idade)} Serie: {int(serie)}')
if lista == C and len(C) < 3 and dados not in C and dados not in B and dados not in A:
b = random.randint(0, 11)
C.append(f'Nome: {nome} Idade: {int(idade)} Serie: {int(serie)}')
if lista == D and len(D) < 3 and dados not in C and dados not in B and dados not in A:
b = random.randint(0, 11)
D.append(f'Nome: {nome} Idade: {int(idade)} Serie: {int(serie)}')
print('')
print(A)
print(B)
print(C)
print(D)
print('')
print('Grupo A')
for k in range(0, 3):
if len(A) > 1:
print(A[k])
print('')
print('Grupo B')
for q in range(0, 3):
if len(B) > 1:
print(B[q])
print('')
print('Grupo C')
for w in range(0, 3):
if len(C) > 1:
print(C[w])
print('')
print('Grupo D')
for s in range(0, 3):
if len(D) > 1:
print(D[s])
print('')
print(f'A media de alunos do 1 ano inscritos: {(len(c1)/len(c2)*100):.02f}')