Skip to content

Commit 2247ba3

Browse files
knapsack.py
1 parent 5fece1e commit 2247ba3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

knapsack.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ def knapsack_max_profit(weights,costs,capacity):
1515
selected_items.append(i-1)
1616
total_weight==weights[i-1]
1717
return table[num_items][capacity],selected_items
18-
# weights=[2,3,4,5] (lines 18,19,20 are used only if given in question)
19-
# costs=[10,20,30,40] (lines 21-25 used for user input only)
18+
# weights=[2,3,4,5]
19+
# costs=[10,20,30,40]
2020
# capacity=10
2121
weights = input("Enter the weights of the items: ").split()
2222
weights = [int(w) for w in weights]

0 commit comments

Comments
 (0)