I've been a professional C, Perl, PHP and Python developer.
I'm an ex-sysadmin from the late 20th century.
These days I do more Javascript and CSS and whatnot, and promote UX and accessibility.
yes, array.sort and sorted take a named parameter in Python 3 (I had to learn this a couple of days ago!) which is run as a callback, once per key, immediately before sorting the elements. So that example calls x: x["age"] on every element first.
It's the equivalent of this:
yes,
array.sort
andsorted
take a named parameter in Python 3 (I had to learn this a couple of days ago!) which is run as a callback, once per key, immediately before sorting the elements. So that example callsx: x["age"]
on every element first.It's the equivalent of this:
and this: