Advertisement
Advertisement
#Python - while loop example
i=0;
while(i<5):
print("i =", i)
i=i+1
i = 0
i = 1
i = 2
i = 3
i = 4
#Python - indefinite while loop example
i=0;
while(i<5):
print("i =", i)
#Python - while loop with optional else statement example
i=0;
while(i>5):
print("i =", i)
else:
print("i is not greater than 5")
i is not greater than 5
Advertisement
Advertisement
Please check our latest addition
C#, PYTHON and DJANGO
Advertisement