ab=0
while ab==0:
ab=input("enter here:")
if ab==1:
print("print this ab==1")
elif ab==2:
print("print this ab==2")
elif ab==3:
print("print this ab==3")
elif ab==4:
print("print this ab==4")
else:
print("try again")
result:
enter here:2
try again
When I take input as a 1,2,3,4 or anything, it returns else condition (prints "try again") And loop ends here
output:
enter here:4
try again
and loop is terminated
when my input is 1/2/3/4, I expect corresponding elif condition, but the actual output is else condition and after the result loop is terminated