vendredi 22 octobre 2021

How i can i implement the function in the if statement

How could i implement the function inside the if statement because when i try to run it it would print out the else case scenario

def miles(kilometers):
    x = kilometers * 0.62
    print(x,"miles")


choice = input("Enter choice:")

if choice == 1:
    miles(20)
else:
    print("another number")

Aucun commentaire:

Enregistrer un commentaire