get second element of a sorted array python with order of n code example Example: sorting by second element sorted(LISTNAME, key=lambda x: x[1])