Okay, let's write a loop in a Step Function!
By now, you can tell that the Python code is going to be obvious: just write a Python loop. Let's start with a pretty simple while loop. Cohesion transforms the Python while loop into a step function choice state and loop.
The break
and continue
statements are supported, and work as you'd expect -- break generates a control flow edge that jumps out of the loop, and continue causes a jump to the next loop iteration.