WHILE LOOP ANIMATOR
▲
▼
▲
▼
▲
▼
— press STEP or AUTO to animate
FUNCTION BUILDER
(params):
PARAMETERS
BODY (return expression)
— build your function and press CALL
QUICK REFERENCE
WHILE LOOP STRUCTURE
i = 0
while i < limit:
# body executes while True
i += 1 # must update!
BREAK & CONTINUE
while True:
if condition:
break # exit loop
if skip_this:
continue # next iteration
FUNCTION ANATOMY
def name(param1, param2):
"""docstring (optional)"""
result = param1 + param2
return result
CALLING & SCOPE
output = name(3, 4) # call
print(output) # 7
# Variables inside def are local
# Use return to pass values out