使用SORT函数或将列表转换为元组再使用SORTED函数。
代码实例:
my_list = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5, 8, 9, 7] my_list.sort() print(my_list)
my_tuple = tuple(my_list) sorted_tuple = sorted(my_tuple) print(sorted_tuple)
上一篇:不能在连接到Dataverse表的SQL查询中使用CTE(在SSMS中)。
下一篇:不能在另一个函数中使用hooks调用函数。