Lesson 1.5 · Trace it
Trace: two variables
Python code6 rows to fill2 marks
Complete the trace table for this Python code. [2]
Line 1: a = 1Line 2: b = 10Line 3: a = a + bLine 4: print(a)Line 5: b = a - bLine 6: print(b)
Fill in one row each time a line changes a or b, or prints something. The table already has the right number of rows. In each row, write only what that line changes; you can leave the other cells empty or copy their values down. Write values the way Python shows them: 3 and 3.0 are different, and text goes in quotes. In the output column, write exactly what appears on screen, with no quotes around it.
| Row | a | b | output |
|---|---|---|---|
| 1 | |||
| 2 | |||
| 3 | |||
| 4 | |||
| 5 | |||
| 6 |