Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python do while loop

# A python equivilant to do-while
n = 0
while True: # Do
  print(n)
  n += 1
  if n%3 == 0: # While
    break
# Output: 0, 1, 2
Source by coderwall.com #
 
PREVIOUS NEXT
Tagged: #python #loop
ADD COMMENT
Topic
Name
1+4 =