You are viewing a single comment's thread. Return to all comments →
not sure why, but when I run your code as it is I get an error: if((y)<=len(list)): list[y] -= incr; IndexError: list index out of range
but when I do run that line like this:
if((y)<=len(list)): list[y-1] -= incr;
that works
Seems like cookies are disabled on this browser, please enable them to open this website
Array Manipulation
You are viewing a single comment's thread. Return to all comments →
not sure why, but when I run your code as it is I get an error: if((y)<=len(list)): list[y] -= incr; IndexError: list index out of range
but when I do run that line like this:
if((y)<=len(list)): list[y-1] -= incr;
that works