Knapsack Problem Dynamic Programming Python