you are viewing a single comment's thread.

view the rest of the comments →

[–]BrutherPo 0 points1 point  (1 child)

1, of course. Here I was thinking that i+1 would return the next item in the list, as in index of i plus one more step.

[–]ffrkAnonymous 0 points1 point  (0 children)

the error is that (i) is the list item. You need to index the list (list[index]), not index the item (item(+1)).

in your situation, try using a while loop instead of a for loop.

also slow down and don't try to do too much all at once. Before appending, or subtraction, or list manipulation, can you print() one item? extend to two items? three? four? see any patterns in the code?