lundi 15 juin 2020

Python: Why wont the if statement detect whether the variables are greater or less than 80?

print("=~=~=~=~=~=~=~=~=~=~=")
print("")
height = float(input("Input the height (cm): "))
width = float(input("Input the width (cm): "))
length = float(input("Input the length (cm): "))
print("")
print("=~=~=~=~=~=~=~=~=~=~=")


if height or width or length > 80:
    print("Rejected, measurements exceed 80cm.")
elif height or width or length < 80:
    print("Works")
else:
    print("Error")

It prints the rejected message when I enter numbers lower than 80 and larger than 80. Anyone see what im missing?

Aucun commentaire:

Enregistrer un commentaire