Method Definition Line Property
After LW Python reads a new method definition statement, it increments the line by 1.
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 line at time (t + 1) = i + 1
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 line at time (1 + 1) = 2 + 1
Try stepping through the simulator to see LW Python step to the next line.
Code Editor
LW Python State
Current Line | 1 | Current Tab | 0 | Time | 0 |
LW Python Simulator
Comments
Please log in to add comments