why while loop is not executing in an if statement

  Kiến thức lập trình

I have started learning Python and try to use the while loop in an if-else statement but is not executing as it’s supposed to be. Can you explain me why
this the code

a = int(input("enter number: "))
if(a<21):
while (a>=20):
  print(a)
  a = a + 1

else:
  print("your numer should be less then 20")

I was expecting to print numbers till the 20th number

New contributor

Pranay Domal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

1

LEAVE A COMMENT