Every step is remembered: the run can go back, and the timeline slider goes to any step, also after the end.

a = [7, 3, 9, 1, 5]
for i in range(1, len(a)):
    key = a[i]
    j = i - 1
    while j >= 0 and a[j] > key:
        a[j + 1] = a[j]
        j -= 1
    a[j + 1] = key
print(a)

Student
  1. Click Step several times, then Step back: the variables are as they were.
  2. After the end drag the slider Position in the run: watch how key moves left through the list.
  3. Step again with the same input starts over with the same input.
Teacher
  1. Use it to find the step where a value goes wrong: go forward to the wrong output, then back.