Computer science · Grades 7–11
Python-style code tracing · revision card
Use a small table of variable values after each statement.
Keep these ideas clear
Track values
Use a small table of variable values after each statement.
Range stops before the end
In Python, range(start, stop) excludes stop. These questions do not execute user-written code.
Two useful examples
Python: x = 4; x = x + 6. What is x?
10
10
Python: total = 0 for n in range(1, 5): total += n What is total?
1 + 2 + 3 + 4 = 10
10
Explain it without looking
- Explain the distinction between = and == in Python.
Further reading and review references
These are reference links, not copied exercises, institutional endorsement or proof of independent review.
Learning preview · teacher review required. Grade bands are approximate, not official curriculum alignment.