Constant Assignment Property

if the following are true:
  • the line at time t = i
  • the tab at time t = j
  • statement at line i, tab j = x = c
  • c is constant

then Variables Map at time (t + 1) = result of storing c at key: x in map: (Variables Map at time t)

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 = x = 9

then Variables Map at time (0 + 1) = result of storing 9 at key: x in map: (Variables Map at time 0)

Try clicking "Next" to see LW Python update the variable map.

Code Editor
LW Python State
Current Line1Current Tab0Time0
LW Python Simulator

Quiz (1 point)

Based on the Constant Assignment Property format, please complete the following statement:

if the following are true:

  • the line at time 1 = 1
  • the tab at time 1 = 0
  • statement at line 1, tab 0 is z = 11

then at time = 2, variable z = ___

Become a subscriber to save your progress, see the correct answer, and more!

Comments

Please log in to add comments