While Test State Property
If there is a "while" statement at the current line and tab, and the expression state is "not_expr" at time t, then at time t + 1, the expression state is updated to "begin_expr." 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 = "while" statement with condition (function call with name: name and arguments: args)
- expression state at time t = "not_expr"
then expression state at time (t + 1) = "begin_expr"
When Python sees an "while" statement, Python first evaluates the test.
For example,
if the following are true:
- the line at time 1 = 2
- the tab at time 1 = 0
- statement at line 2, tab 0 =
while __lt__(a, 2):
- expression state at time 1 = "not_expr"
then expression state at time (1 + 1) = "begin_expr"
Code Editor
LW Python State
Current Line | 1 | Current Tab | 0 | Time | 0 |
LW Python Simulator
Comments
Please log in to add comments