# take second element for sort
def takeSecond(elem):
    return elem[1]

# random list
random =  [('item1', '12.20'), ('item2', '15.10'), ('item3', '24.5')]

# sort list with key
random.sort(key=takeSecond)
random.sort(reverse=True)

# print list
print('Sorted list:', random)
ba73fc95112ac025d060bb6aea1e65dc5d87e7b2
<mask token>

def takeSecond(elem):
    return elem[1]


<mask token>

def takeSecond(elem):
    return elem[1]


<mask token>
random.sort(key=takeSecond)
random.sort(reverse=True)
print('Sorted list:', random)

def takeSecond(elem):
    return elem[1]


random = [('item1', '12.20'), ('item2', '15.10'), ('item3', '24.5')]
random.sort(key=takeSecond)
random.sort(reverse=True)
print('Sorted list:', random)

# take second element for sort
def takeSecond(elem):
    return elem[1]

# random list
random =  [('item1', '12.20'), ('item2', '15.10'), ('item3', '24.5')]

# sort list with key
random.sort(key=takeSecond)
random.sort(reverse=True)

# print list
print('Sorted list:', random)