Custom list sorting in Python

sl = sorted(["The", "lazy", "fox"], key=str.upper)

Using a lambda

sl = sorted(["The", "lazy", "fox"], key=lambda x: x[1])

This will sort by the second letter of each word.