I have 2 inputs for my app, a and b. I want to show the inputs if my initial variable is not 0. Here is my code:
import random
init = 100
while init > 0:
x = random.randint(0,24)
a = int(input("input value a:"))
if a < 25:
b = int(input("input value b"))
if b <= init:
init -= b
else:
print("b should smaller than init")
else:
print("a should between 0 and 24")
When I run and put a value for a more than 25, I got the else a < 25, and redirect again to input value a again until it is less than 25. When I put value b more than init, the output from else b <= init was printed but I was not redirected to input b again, instead to input value a after while. How do I redirect to the part where I input b?