If Test True Line Property

If the "if" statement test evaluated to True at time t, then LW Python increments 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 = if test:
  • expression state at time t = "end_expr"
  • Return Value at time t = True

then the line at time (t + 1) = i + 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 line at time (10 + 1) = 1 + 1

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

Code Editor
LW Python State
Current Line1Current Tab0Time0
LW Python Simulator

Comments

Please log in to add comments