values = [ 4, 7, 10, 5, 3]
maxV = max(values)
maxI = values.index(maxV)
print(f"Max value: {maxV}")
print(f"Max value index: {maxI}")
Max value: 10
Max value index: 2
weights = [15, 8, 2, 6, 12 ]
maxW = max(weights)
maxI2 = weights.index(maxW)
print(f"Max weight: {maxW}")
print(f"Max index: {maxI2}")
Max weight: 15
Max index: 0
values = [ 4, 7, 10, 5, 3] # we need to reload these lists because we modified them
weights = [15, 8, 2, 6, 12 ] # in loop above
v = len(values)
for items in range (0, v)
item_values = max(values)
maxI = values.index(values_m)
There’s an error in this block
Try running the app again, or contact the app’s creator
values = [4,7, 10, 5 , 3]
weights = [15, 8, 2, 6, 12]
for item in range (0, v)
v = len(weights):
item_values = index.weights
print (item_values)
There’s an error in this block
Try running the app again, or contact the app’s creator