I write Python and JavaScript where the first element is index 0, and I keep making off-by-one mistakes on the multiple-choice questions.
Accepted answer
That's a real difference, not a mistake on your part: lists in the AP Exam Reference Sheet pseudocode are **1-indexed**, so the first element is `list[1]` and the last is `list[LENGTH(list)]`. Python, Java, and JavaScript are all 0-indexed.
On exam questions, deliberately switch modes: read `list[1]` as "the first element." A useful check is the last element — in pseudocode it's `LENGTH(list)`, while in your code it's `length - 1`. Most off-by-one errors on these questions come from carrying the 0-indexed habit in.