{"url":"https://inarizuuuushi.hatenablog.com/entry/2016/12/02/085414","author_url":"https://blog.hatena.ne.jp/inarizuuuushi/","provider_url":"https://hatena.blog","blog_url":"https://inarizuuuushi.hatenablog.com/","categories":[" python "],"height":"190","title":" Python \u30b3\u30fc\u30c7\u30a3\u30f3\u30b0(\u57fa) list\u7de8","published":"2016-12-02 08:54:14","author_name":"inarizuuuushi","version":"1.0","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Finarizuuuushi.hatenablog.com%2Fentry%2F2016%2F12%2F02%2F085414\" title=\" Python \u30b3\u30fc\u30c7\u30a3\u30f3\u30b0(\u57fa) list\u7de8 - Sabrou-mal \u30b5\u30d6\u30ed\u30a6\u4e38\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","image_url":null,"type":"rich","width":"100%","blog_title":"Sabrou-mal \u30b5\u30d6\u30ed\u30a6\u4e38","provider_name":"Hatena Blog","description":"list\u64cd\u4f5c(\u57fa)sort\u306e\u8a71\u3067\u3059. sort sort\u3068sorted\u306e2\u7a2e\u985e. \u4f7f\u3044\u65b9\u305d\u306e\u4ed6\u306f\u4e0b\u8a18. a = [2, 3, 4, 1] sorted(a) > [1, 2, 3, 4] #a\u306esort\u5f8c\u306elist\u304c\u51fa\u529b\u3055\u308c\u308b a > [2, 3, 4, 1] #a\u306b\u5909\u5316\u306f\u306a\u3057 a.sort() a > [1, 2, 3, 4] #a\u81ea\u4f53\u304csort\u3055\u308c\u3066\u3044\u308b. sorted(a, reverse=True) > [4, 3, 2, 1] #\u964d\u9806\u306bsort def func(x): return x%4 sorted(a, key=func) > [4, 1, 2, 3] #key\u306b\u95a2\u6570\u3092\u6307\u5b9a\u3067\u2026"}