samedi 18 juillet 2020

I think my if else statement is not working

This is the Code

Age = int(input("Enter Your Age: "))
    if (Age > 18):
        print("Your are 18+")
        pass
    if (Age == 18):
        print("Your are 18")
        pass
    else:
        print("You are below 18")

This is the Output

Enter Your Age: 20
Your are 18+
You are below 18
  1. When Age > 18 it should print "Your are 18+"
  2. When Age == 18 it should print "Your are 18"
  3. When Age < 18 it should print "Your are below 18" What is happening here?

Aucun commentaire:

Enregistrer un commentaire