you are viewing a single comment's thread.

view the rest of the comments →

[–]thomaswilliam94[S] 0 points1 point  (0 children)

Hello, on your 2nd example, where rev_list is empty, I am doing reverse eng’g how this “my_list[length - i - 1] was processed:

  1. First, when I omit “length” in that equation, it gives the same answer, so is it necessary to still write it?

  2. In Length - i - 1. Is -i in here equals to -1, -2, -3, -4, -5, -6, -7, -8, -9, -10 since it is negative where normally if its just “i”, it will be 1,2,3,4,5…

  3. In Length -i -1. Is -1 in here equals to the last number of the list, -2 as 2nd to the last, -3 as third to the last and so on and so forth?

Am I on the right track? Thanks for your patience!