LoginSignup
1
0

More than 5 years have passed since last update.

python sorted keyparameterについて

Posted at

pythonのkeyparameterについて、今まで曖昧な理解だったが下記のサイトで理解が深まった。

書いてあることは、sorted(iterable,key=function name)
このような場合、iterableの各項目に対して、key=で指定されたfunctionに放り込まれる。
でその帰ってきた結果を元の値に関連付けされ、それに対してsortされる。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0