def knapSack(cap, wt, val, n, stuff): # initial conditions items_to_pack=[] if n == 0 or cap == 0 : return 0 # If weight is higher than capacity