my knapsack code does not work in python 3 can anyone help what is the problem with my code?
my knapsack code does not work in python 3 can anyone help what is the problem with my code? Question: def knapSack(W, wi, pi, i): if i == 0 or W == 0: return 0 if (wi[i-1] > W): return knapSack(W, wi, pi, i-1) else: return max( pi[n-1] + knapSack( W-wi[n-1], wi, pi, n-1), knapSack(W, …