Elif False Tab Property

If the "elif" statement tested False, then the tab number remains the same. 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 = False

then the tab at time (t + 1) = j

If the "elif" statement tested False, then skip the "elif" body by leaving the tab unchanged. 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__(7, 9):
  • expression state at time 22 = "end_expr"
  • Return Value at time 22 = False

then the tab at time (22 + 1) = 0

Try stepping through the simulator to see the tab number remain at 0 after the "elif" test is evaluated.

Code Editor
LW Python State
Current Line1Current Tab0Time0
LW Python Simulator

Comments

Please log in to add comments