I am trying to put a list of groceries into python and then ranking them with the lowest price being first. Does anyone know how I could display this so the result would look like:
Popcorn: 1.23
Eggs: 3.77
Water: 4.34
Milk: 7.12
Toast: 8.45
This is what I have tried so far
price_list = [["Eggs", "3.77"], ["Toast", "8.45"], ["Milk", "7.12"], ["Water", "4.34"], ["Popcorn", "1.23"]]
print("Original order: ", price_list)
price_list.sort()
print("Sorted Order: ", price_list)