官术网_书友最值得收藏!

Reverse sort

z.sort(reverse=True)
z

The output of the above code is as follows:

[3, 2, 1]

If you need to do a reverse sort, you can just say reverse=True as an attribute, as a parameter in that sort function, and that will put it back to 3, 2, 1.

If you need to let that sink in a little bit, feel free to go back and read it a little bit more.

主站蜘蛛池模板: 彭州市| 汕尾市| 扎鲁特旗| 灌南县| 永顺县| 永靖县| 江源县| 红桥区| 乐清市| 额尔古纳市| 高邮市| 垦利县| 集安市| 凌海市| 依安县| 曲沃县| 东乡| 六盘水市| 深水埗区| 萨嘎县| 无锡市| 容城县| 玛多县| 华坪县| 屏南县| 台中市| 梁山县| 阜平县| 双流县| 富川| 昭平县| 哈尔滨市| 谷城县| 灯塔市| 商城县| 汽车| 苍南县| 新津县| 天祝| 如东县| 伊川县|