CodeField

Dry run (trace table)

Dry run this program. Add a row each time a name gets a value, or the program prints.

  1. g = 2
  2. h = g + 6
  3. g = h * 2
  4. print(g - h)
  1. Row 1, given: g = 2
  2. Row 2

Your rows as a trace table
RowghOutput
12
2

Tips

  • Add a row only when a name gets a value, or the program prints.
  • Follow every line in order, and go round a loop as many times as Python would.