How can I optimize my greedy knapsack algorithm for better performance in Python

visit shbcf.ru