Answers for "python for loop as a while loop"

23

how to write a while statement in python

myvariable = 10
while myvariable > 0:
  print(myvariable)
  myvariable -= 1
Posted by: Guest on January-08-2020
0

python while loop

x = 0

while x < 5:	# This is the loop condition, the loop will repeat WHILE thid condition is true
	print(x)
    x += 1
	if x == 3:
    	break	# This break statment will end the loop no matter what
Posted by: Guest on January-31-2022

Code answers related to "python for loop as a while loop"

Python Answers by Framework

Browse Popular Code Answers by Language