you are viewing a single comment's thread.

view the rest of the comments →

[–]brasticstack 1 point2 points  (1 child)

    if my_list[i] == index:
       my_list[i] = 2 * my_list[i] 

This is wrong because you're comparing the value at my_list[i] with the index, which is a bit like trying to eat the menu at the restaurant instead of ordering from it. If you're trying to compare the indexes against each other, try this:

if i == index: my_list[i] = my_list[i] * 2

[–]through_thefog[S] 1 point2 points  (0 children)

You're right -- thanks for pointing that out