Trace Table Layout

Draw a table with one column per variable and one row per step. Write the starting value on row 0, then one row per line executed.

Example โ€” Find Max

lst = [4, 7, 2, 9, 5]
best = lst[0]
for x in lst[1:]:
    if x > best:
        best = x
print(best)
Stepxbest
initโ€”4
177
227
399
459

Rules for Clean Tracing

Practise this on PyForm โ€” free

PyForm runs Python in your browser with an AI tutor trained for HKDSE. No install, no credit card.

Open PyForm โ†’