Python, Numbers, Sorting.
dealing with a list of tuples, you can sort based on a specific element within the tuples using the key parameter. data = [(3, 10), (1, 5), (4, 8)] sorted_data = sorted(data, key=lambda x: x[1]) # Sort based on the second element of each tuple print(sorted_data) # Output: [(1, 5), (4, 8), (3, 10)]