jeudi 28 janvier 2021

Call multiple functions in elif statement python [duplicate]

I am trying to call multiple functions in a conditional but is impossible :/

Here is my code:

print("""
    1. Something 1
    2. Something 2
    3. Something 3 """)
    
user = input("Choose some option: ")

def one():
    print("Something...")

def two():
    print("Something 2...")

def three():
    print("Something 3...")

if user == 1:
    one()
elif user == 2:
    two()
elif user == 3:
    three()

But I don´t know when I choose some option (1-3) never print the function...

Aucun commentaire:

Enregistrer un commentaire