Skip to content

Instantly share code, notes, and snippets.

@maluta
Created October 28, 2014 14:10
Show Gist options
  • Save maluta/b5a7d4a74013fe29185a to your computer and use it in GitHub Desktop.
Save maluta/b5a7d4a74013fe29185a to your computer and use it in GitHub Desktop.
#
perguntas = {
"a":"pergunta referente a opção a",
"b":"pergunta referente a opção b",
"c":"pergunta referente a opção c",
"d":"pergunta referente a opção d"
}
def funcionalidade_A():
print("+-+")
print("|A|")
print("+-+")
def funcionalidade_B():
print("+-+")
print("|B|")
print("+-+")
def funcionalidade_C():
print("+-+")
print("|C|")
print("+-+")
def funcionalidade_D():
print("+-+")
print("|D|")
print("+-+")
def menu():
print("Menu:")
for opção in "abcd":
print(opção + " - " + perguntas[opção])
def entrada_do_usuário():
return input("Qual opção você deseja? ")
while True:
menu()
resposta = entrada_do_usuário()
if resposta == 'a':
funcionalidade_A()
elif resposta == 'b':
funcionalidade_B()
elif resposta == 'c':
funcionalidade_C()
elif resposta == 'd':
funcionalidade_D()
else:
print("Resposta inválida, saindo...")
quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment