There are flaws in your program logic but here is my go at the question. My assumption is you want to find the item with the highest price to mass ratio. In my code I compare the value of the item given compared to the best value so far.
best_item = "None"
best_value = 0
while True:
mass = input("Enter mass (Type done to finish): ")
if mass == "done":
break
mass = float(mass)
price = float(input("Enter price: "))
value = price / mass
if value > best_value:
best_value = value
best_item = "Mass: " + str(mass) + " Price: " + str(price) + " Value: " + str(value)
print("Best item: " + best_item)
Sample Run
Enter mass (Type done to finish): 1
Enter price: 1
Enter mass (Type done to finish): 1
Enter price: 2
Enter mass (Type done to finish): 2
Enter price: 1
Enter mass (Type done to finish): done
Best item: Mass: 1 Price: 2.0 Value: 2.0