Trace Table with Outputs

Step through the Python code — watch variables and console output change

Speed: 500ms
Step 0 of 16

Python Code

1 sum = 0
2 for i in range(1, 6):
3     sum = sum + i
4     print("After adding", i, "sum is", sum)
5 print("The total sum is:", sum)

Trace Table

Step Line i sum Output Explanation

Console Output

>>> Run program...
Previous   Next   Space Auto-play