CodeField

Repeat it

Task 2 of 7

Dry run (trace table)

Dry run this program. Add a row each time a name gets a value, or the program prints.

  1. n = 24
  2. count = 0
  3. while n > 1:
  4. n = n // 2
  5. count = count + 1
  6. print(count)
  1. Row 1

Your rows as a trace table
RowncountOutput
1

Tips

  • Add a row only when a name gets a value, or the program prints.
  • Follow every line in order, and go round a loop as many times as Python would.