Implementation of the Knapsack Problem in Python