why does code repeat after questions are answered?

The questions are repeated because you are asking them after def bank:

def bank():
    Checkings = 100
    Savings = 100
    Checkings_TO = int(input("How much would you like to take out: " + "$")) #Here
    x = Checkings_TO
    Checkings_PI = int(input("How much would you like to put in: " + "$")) #Here
    y = Checkings_PI

And then one more time if one of the if statements is true.

Also you should change the usage of return in your function. I don’t know if it was what you wanted to achieve, but I think it should be like this:

if Section == ("Checkings"):
    how_much_take = int(input("How much would you like to take out: " + "$"))
    how_much_put = (int(input("How much would you like to put in: ")))
    print ("Here is your total: " + "$" + str(x))

if Section == ("Savings"):
    how_much_take = int(input("How much would you like to take out: " + "$"))
    how_much_put = (int(input("How much would you like to put in: ")))
    print ("Here is your total: " + "$" + str(y))

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top