Class Statement Tab Property

When LW Python sees a "class" statement, it will enter the "class" body by incrementing the tab 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 = a class named name with bases: bases

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

For example, if the following are true:
  • the line at time 0 = 1
  • the tab at time 0 = 0
  • statement at line 1, tab 0 = class Person:

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

Try stepping through the simulator to see LW Python enter the "class" body

Code Editor
LW Python State
Current Line1Current Tab0Time0
LW Python Simulator

Comments

Please log in to add comments