num1=0
Stored_num=23
def input_num():
num1=int(input('Enter the number again: '))
while num1!=stored_num:
input_num()
else:
print('Congrats ! The entered number mathched the stored number')
The code above is not accepting the else condition and not printing the message despite entering the stored value i.e. 23.
Please help me understand.
You have named the variable
Stored_numand are usingstored_numto compare. Python is a case sensitive language so these are not the same. Change one of them to the other and it should work fine.