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

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.

主站蜘蛛池模板: 梁平县| 赫章县| 老河口市| 洞口县| 电白县| 当阳市| 安仁县| 卓尼县| 天柱县| 潮州市| 邛崃市| 高淳县| 汤原县| 博白县| 余江县| 兴隆县| 关岭| 义乌市| 岚皋县| 胶州市| 龙川县| 尖扎县| 和龙市| 乡城县| 梁河县| 曲阳县| 清水县| 保山市| 安远县| 松江区| 集贤县| 克拉玛依市| 浦城县| 鸡东县| 合阳县| 延津县| 稷山县| 嵩明县| 苏州市| 两当县| 昆山市|