I'm begging with python so I would like to know how to do a program that reads a code, a price and the quantity of a number of products. Then the program should print the codes of the more costly product and the code of the product with less units. Here what I tried to do:
Price=[]
code=[]
quantity=[]
Num=x
for i in range(x):
code.append(input("product code: "))
price.append(float(input("price: ")))
quantity.append(int(input("quantity: ")))
print(code[max(price)])
print(code[min(quantity)])
ThAnks already!
argmaxand notmax.argmaxis not builtin in python but you can get it from many libraries like numpy. However since you are learning, I would recommend implementing it yourself, it's a good exercise and not hard.