Tracing updates with augmented assignment

The Python program below works only with integers. Trace it line by line and fill in the value held by count and by total immediately after each listed line has run.


Python
count = 4
total = 10
total = total + count
count += 3
total -= count
count = count * total
total = count - total
After linecounttotal
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors