Try this code. I think there is a problem in your code.
b=55
n=input(“Enter a number in between 0-99”)
n=int(n)
if(n==b):
print(“Bingo”)
else:
print(“Better Luck next time”)
In this particular section of code, the value of b will turn out to be 1. Reason that b bein always less than or equal to 21 & hence the if condition if(b<=21)
will be satisfied after incrementing the value of b with 1.
You should try & replace the if condition with:
if(b == 21):
break;
hii,
if you want output like this
Enter any number of your choice from 1 to 20: 10
better luck next time
better luck next time
better luck next time
better luck next time
better luck next time
better luck next time
better luck next time
better luck next time
better luck next time
Bingo
then your code is here
n=int(input("Enter any number of your choice from 1 to 20: "))
b=0
while(b>=0):
b=b+1
if(b==n):
print(“Bingo”)
if(b<n):
print(“better luck next time”)
else:
break
please use proper indentation