python for loop while code example
Example 1: how to write a while statement in python
myvariable = 10
while myvariable > 0:
print(myvariable)
myvariable -= 1
Example 2: while loop in python
# while loop runs till the condition becomes false
number = 0
while number > 10: # prints number till 10
print(number)
number += 1