def exibir_subtitulo(texto):
linha = "-" * len(texto)
print("\n" + texto)
print(linha)
participantes = {
"Workshop de Vendas": {"Alice", "Bruno", "Carla", "Diego"},
"Workshop de Marketing": {"Fernanda", "Gustavo", "Helena"}
}
while True:
exibir_subtitulo("WORKSHOP - Sandálias Politiqueras Saboneteiras")
print("1 - Remover um participante")
print("2 - Cadastrar novo participante em um workshop")
print("3 - Ver participantes por workshop")
print("4 - Ver todos os participantes")
print("5 - Sair")
opcao = input("Escolha uma opção: ")
# OPÇÃO 1 – REMOVER PARTICIPANTE
if opcao == "1":
nome_remover = input("Digite o nome do participante: ")
encontrado = False
for nomes in participantes.values():
if nome_remover in nomes:
nomes.remove(nome_remover)
encontrado = True
if encontrado:
print("Participante removido com sucesso.")
else:
print("Participante não encontrado.")
# OPÇÃO 2 – CADASTRAR PARTICIPANTE
elif opcao == "2":
print("\nWorkshops disponíveis:")
for workshop in participantes:
print("-", workshop)
workshop_escolhido = input("Digite o nome do workshop: ")
if workshop_escolhido not in participantes:
print("Workshop não encontrado.")
else:
nome = input("Digite o nome do participante: ")
if nome in participantes[workshop_escolhido]:
print("Participante já inscrito neste workshop.")
else:
participantes[workshop_escolhido].add(nome)
print("Participante cadastrado com sucesso.")
# OPÇÃO 3 – VER PARTICIPANTES POR WORKSHOP
elif opcao == "3":
exibir_subtitulo("PARTICIPANTES POR WORKSHOP")
for workshop, nomes in participantes.items():
print(f"\n{workshop}:")
if nomes:
for nome in sorted(nomes):
print("-", nome)
else:
print("Nenhum participante.")
# OPÇÃO 4 – VER TODOS OS PARTICIPANTES
elif opcao == "4":
exibir_subtitulo("TODOS OS PARTICIPANTES")
todos = set()
for nomes in participantes.values():
todos.update(nomes)
if not todos:
print("Nenhum participante cadastrado.")
else:
for nome in sorted(todos):
print("-", nome)
# OPÇÃO 5 – SAIR
elif opcao == "5":
print("\nEncerrando o sistema...")
break
# OPÇÃO INVÁLIDA
else:
print("Opção inválida. Tente novamente.")