I have this: {code:[name,price,units]}
I want to print the name of the Product with the highest value.
I have tried this but i can only get the higher price
products = {1:["Product1",8000.0,65], 2:["Product2",2300.0,15], 3:["Product3",2500.0,38],
4:["Product4",9300.0,55], 5:["Product5",2100.0,42]}
higher=0
for code in products:
if products[code][1]>higher:
higher=products[code][1]
print(higher)
9300.0
When I try to show the name of the product with higher=products[code][0]
I get an error
TypeError: '>' not supported between instances of 'float' and 'str'