Begin For Loop Tab Property
If the 'Control' map shows at least one element in the iterable, increment the tab number by 1 to enter the "for" loop body. More formally,
if the following are true:
- the line at time t = i
- the tab at time t = j
- statement at line i, tab j =
for target in iterable_ex:
- value at j in map (Control Map at time t) = trio ("for", i, [ elem, rest ])
then the tab at time (t + 1) = j + 1
if the following are true:
- the line at time 17 = 2
- the tab at time 17 = 0
- statement at line 2, tab 0 =
for value in numbers:
- value at 0 in map (Control Map at time 17) = trio ("for", 2, [ 1, [ 2, [ 3, [ ] ] ] ])
then the tab at time (17 + 1) = 0 + 1
Try stepping through the simulator to see LW Python enter the "for" loop body
Code Editor
LW Python State
Current Line | 1 | Current Tab | 0 | Time | 0 |
LW Python Simulator
Comments
Please log in to add comments