If Test True Tab Property

If the "if" statement test evaluated to True at time t, then at time t + 1, the tab number is incremented 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 = if test:
  • expression state at time t = "end_expr"
  • Return Value at time t = True

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

For example, if the following are true:

  • the line at time 10 = 1
  • the tab at time 10 = 0
  • statement at line 1, tab 0 = if __eq__(3, 3):
  • expression state at time 10 = "end_expr"
  • Return Value at time 10 = True

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

Try stepping through the simulator to see the tab number increment by 1.

Code Editor
LW Python State
Current Line1Current Tab0Time0
LW Python Simulator

Comments

Please log in to add comments