Knapsack Problem In Python Code