Code
n=int(input("enter a number"))
i=0
while i<n:
print(i)
i=i+1
Output
This code snippet for While Loop in Python.
n=int(input("enter a number"))
i=0
while i<n:
print(i)
i=i+1
Output