vendredi 6 décembre 2019

What should I do if an else statement is not executing after if/elif statements didn't meet the condition?

I have an issue with my codes. I received an output meant for an if statement whenever the rice_ingredients = input("How many ingredients: ") is > 8 instead of the output of else statement which should be "Too much ingredients, unprofessional!"

def Chef() -> int:
    rice_ingredients = input("How many ingredients: ")
    for ingredients in rice_ingredients:
        if ingredients <= str(6):
            print("Professional")
        elif ingredients == str(7) or str(8):
            print("Well, can still be considered professional")
        else:
            print("Too much ingredients, unprofessional!")
        exit()

Aucun commentaire:

Enregistrer un commentaire