You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Deixando em standby este código que eu achei lindo, mas que infelizmente meus conhecimentos atuais sobre dicionários não permitiram que eu o concluísse.
# Um professor quer sortear um dos seus quatro alunos para apagar o quadro.
# Faça um programa que ajude ele, lendo o nome deles e escrevendo o do escolhido.
import random
nomes = ["Black Panther", "Solid Snake", "Kendrick Lamar", "Shadow the Hedgehog"]
classe = {}
contador = 1
num = random.randint(1, 4)
for nome in nomes: # Para cada nome na lista nomes
classe[nome] = contador # Adicione a esse nome o valor atual da variável contador
contador += 1 # Atualize o contador para que ele chegue a 4 no fim dos loops