mercredi 4 novembre 2020

If-else conditions aren't working as expected

a=int(input("Enter first number"))
b=int(input("Enter second number"))



if mood == "happy" and face == "smiling":
   result = "Happy!"

elif mood == "sad" and face == "smiling":
   result = "you aren't okay, what happened?"

elif mood == "sad" and face == "sad":
   result = "you are sad, what happened?"

else:
   result = "Some error occurred. I guess it needs a recheck!"




if a > b:
   print("[Positive] If I am not wrong, you are ", result)

elif a < b:
   print("[Negative] If I am not wrong, you are ", result)

elif a == b:
   print("[Neutral] If I am not wrong, you are ", result)

else:
   print("I am still a beginner :)")

The result is always printed "If I am not wrong, you are Happy!". Even if any other condition is positive, the result is always Happy. Is if-else not working, or is there something else?

Aucun commentaire:

Enregistrer un commentaire