Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to repeat code in python until a condition is met

a = 1
b = 1
while (a<10):
  print ('Iteration',a)
  a = a + 1
  b = b + 1
  if (b == 4):
    break
print ('While loop terminated')
Source by www.trytoprogram.com #
 
PREVIOUS NEXT
Tagged: #repeat #code #python #condition #met
ADD COMMENT
Topic
Name
2+7 =