I want the inner while loop to be broken when the input data is 5, but if the input is other than 5, the loop will be executed again. In this code, the input value of each number I enter is printed as X = 1:
x = 1
while True:
def state():
x = input("Enter Your number:")
while True:
print(x)
if x==5:
print('x=5')
break
state()
In this code, I tried to solve the problem but it didn't work too.
condition = True
x = 1
while True:
def state():
x = input("Enter Your number:")
while condition:
print(x)
if x==5:
print('x=5')
condition = False
state()
Is there anyone to help me?