Method Definition Tab Property
After LW Python reads a new method definition statement, it keeps the tab number the same. Thus, Python will skip the method body.
if the following are true:
- the line at time t = i
- the tab at time t = j
- statement at line i, tab j = a method named method_name with parameters params
then the tab at time (t + 1) = j
if the following are true:
- the line at time 1 = 2
- the tab at time 1 = 1
- statement at line 2, tab 1 =
def __init__(self, first_name, last_name, age):
then the tab at time (1 + 1) = 1
Try stepping through the simulator to see LW Python skip the method body.
Code Editor
LW Python State
Current Line | 1 | Current Tab | 0 | Time | 0 |
LW Python Simulator
Comments
Please log in to add comments