mardi 15 novembre 2016

If's and Inputs [duplicate]

n = input("Does the device turn on? ")
if n == "No" or "no":
    k = str(input("Please enter a number corrisponding to the problem.\n"
              "1 = Water damage.\n"
              "2 = Drop damage."))
    if k == "1":
        print("Put device in rice for at least 24 hours and retry.")
elif n == "Yes" or "yes":
    j = str(input("Please enter a number corrisponding to the problemdhdhdh.\n"
              "1 = Water damage.\n"
              "2 = Drop damage."))

This is my code. When it is run if the user inputs "no" then it should go through the first if statement however if the user inputs "yes" then it does not continue with the code for yes. Basically the code runs however the code does not go through the elif statement separately. I don't understand why it does not work.

Aucun commentaire:

Enregistrer un commentaire