sorted() function takes a second argument (‘key’) which allows you to choose by what to determine the sorting.
“lambda” is a way to create a function in Python in one line. The syntax is kinda confusing, first “i” is the input (the current element of the list), “i.value” is the output (which is used for sorting). You could use an ordinary function, but that would take more lines.