Answers for "sorting a list of lists in python"

0

python sort list

# example list, product name and prices
price_data = [['product 1', 320.0],
             ['product 2', 4387.0],
             ['product 3', 2491.0]]

# sort by price
print(sorted(price_data, key=lambda price: price[1]))
Posted by: Guest on October-20-2021
2

sort list in python

List_name.sort()
This will sort the given list in ascending order.
Posted by: Guest on February-03-2020

Code answers related to "sorting a list of lists in python"

Python Answers by Framework

Browse Popular Code Answers by Language