Elif Line Property
If the "elif" statement tested True, then increment the line number by 1. 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 =
elif test:
- expression state at time t = "end_expr"
- Return Value at time t = True
then the line at time (t + 1) = i + 1
If the "elif" statement tested True, then begin evaluating the "elif" block by incrementing the line (and tab) by 1.
For example,
if the following are true:
- the line at time 22 = 3
- the tab at time 22 = 0
- statement at line 3, tab 0 =
elif __eq__(3, 3):
- expression state at time 22 = "end_expr"
- Return Value at time 22 = True
then the line at time (22 + 1) = 3 + 1
Try stepping through the simulator to see LW Python increment the line number to 4.
Code Editor
LW Python State
Current Line | 1 | Current Tab | 0 | Time | 0 |
LW Python Simulator
Comments
Please log in to add comments