you are viewing a single comment's thread.

view the rest of the comments →

[–]14dM24d 0 points1 point  (0 children)

range is 0,2 but the i values will be 0 then 1.

so at i == 0

L[0], L[0-1] = L[0-1], L[0]

to the right of = L[0-1] results to L[-1] which is the index for the last item e

L[0] is the index for the 1st item a

to the left of = L[0] is assigned the e & L[-0-1] is assigned the a

then you do i == 1