The extra rise
transcript
Speeds: four, two, seven, one, eight, three. Count the rises by hand. You get two. The job says three.
Make a table. One row for each place. Write the reading and the one before it. Mark a rise only when it is higher. A table makes the run visible. You can check each row.
Six readings give five comparisons. Seven beats two. Eight beats one. The hand count is two.
The job starts at place zero. It compares with place minus one. In Python that is the last reading. Nothing crashes, so no error shows. Only the answer is wrong.
Four is higher than three. So the job counts one extra rise. Start the loop at place one. Now the job returns two.
Trace before you edit. The first differing row is the bug. Then fix the cause. Do not guess at the cause. A trace beats a hunch.
Trace it by hand. Full breakdown in the lecture.