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

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.

主站蜘蛛池模板: 九龙城区| 陇西县| 额尔古纳市| 汉沽区| 唐河县| 苍梧县| 巴南区| 德钦县| 灵武市| 贡觉县| 建始县| 栾川县| 福泉市| 德庆县| 岳西县| 乌拉特前旗| 抚顺县| 朝阳市| 靖州| 寻乌县| 拜泉县| 苍溪县| 平湖市| 徐水县| 昌宁县| 惠州市| 巨鹿县| 香河县| 勃利县| 阿图什市| 蒲江县| 财经| 建始县| 甘孜县| 林西县| 光泽县| 隆昌县| 夹江县| 冷水江市| 治多县| 吉木乃县|