Index out of range error Python greedy methodThanks that fixed that...but lmao just go another index out of range at File "\\minerfiles.mst.edu\dfs\users\asadmb\Desktop\Programming 3\KnapsackClass.py", line 44, in greedy_knap if weight + knap_array[i][1] <= W: IndexError: list index out of range

Oct31

comment

Index out of range error Python greedy methodyes i tried changing the for loop range from 1 to len(v) -1 or from 1 to len(v) + 1 ...Both give me a index out of range error...I am not sure why...maybe because I am trying to make a 2-Dimensional array out of it?