'Program stuck in while loop even though it seems correct
For some reason this gets stuck in a while loop at where it first asks for an input in "userChoice", anyone have a solution?
userStart = input("\n Enter UBM? \n (Yes) \n (No)")
while userStart == "Yes":
p1 = bank(1234, "Bank Bill", "dragon123", 300)
p2 = bank(1235, "Billy Jones", "cookies1231", 300)
p3 = bank(1236, "Johnny Test", "beans100", 300)
userChoice = input("\n You arrive at UBM; The United Bank of MONEY. What account would you like to access? \n (Bank Bill) \n (Billy Jones) \n (Johnny Test) \n ")
if userChoice == "Bank Bill":
p1.passCheck()
userStart = input("\n Stay in UBM? \n (Yes) \n (No)")
elif userChoice == "Billy Jones":
p2.passCheck()
userStart = input("\n Stay in UBM? \n (Yes) \n (No)")
elif userChoice == "Johnny Test":
p3.passCheck()
userStart = input("\n Stay in UBM? \n (Yes) \n (No)")
if userStart == "No":
print("You left UBM.")
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
