Raw Entrada si declaraciones Python [duplicado]
Esta pregunta ya tiene una respuesta aquí:
¿Cómo puedo leer entradas como números? 17 respuestasTengo problemas con las declaraciones if en python. Estoy haciendo un "juego" enteramente en dolan speak, disculpe la ortografía, significa ser de manera humorística. Lo siento
Aquí está el código:
import time
def menu():
print ("dogz r a supar hahrd tin 2 matsr it tak yrs 2 mastr ut u nw git 2 exprince it. pik a tin 2 du:\n")
menu = raw_input("1.)Ply Da Dogi gam\n2.)Halp\n")
if menu == 1:
game()
if menu == 2:
helpGame()
if menu < 2:
print ("dat not 1 ur 2 sry")
time.sleep(1)
menu()
def game():
print ("nuw u ply mi gme u lke it")
def helpGame():
print ("dis da halp u liek it")
menu()
Eso no funciona para mí, y nunca he tenido un trabajo directo de llamada de función dentro de las declaraciones if y he tenido que implementar "seg-way" que llaman a la función.
¿Funciona esto para alguno de ustedes? ¿Es posible que sea mi instalación de Python? ¡Gracias