Skip to main content
Skip table of contents

while

Features

‘while’ is a conditional statement that repeats an operation according to whether the condition is true or false.

syntax

while <conditional statement>:

          <syntax>

Example

PY
sum = 0
cnt = 1
while cnt < 10:
    sum = sum+cnt
    cnt = cnt+1
tp_log("sum = " + str(sum))
#expected result:
#sum = 45
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.