samedi 27 avril 2019

This program is skipping straight from if statement to else statement even though the codition is true

My program is skipping straight from if statement which is true to the else statement and I cannot seem to find the problem

I have tried moving this around and everything but nothing seems to be working

while keepgoing == 0:
    try:
        valuea = float(input("What is your a value: "))
        valueb = float(input("What is your b value: "))
        valuec = float(input("What is your c value: "))
        print (myQuadFormula(valuea,valueb,valuec))
        user_ask = input("Do you want to enter another set of data (yes or no)?: ") 
        if (user_ask[0].lower == "y"):
           print ("Enter your data below")
        else:   
            exit ()
    except ValueError:
        print ("Input a valid number")

I expected the program to restart the loop when a person types in yes and to exit if the person types in no

Aucun commentaire:

Enregistrer un commentaire