#reversed()反转排序,可对列表.元组.区间等进行排序 #练习1 a = range(10) a_list = [x for x in reversed(a)] print(a_list) #运行结果 [9, 8, 7, 6, 5, 4, 3, 2, 1, 0] #练习2 a = [1,2,3,4,5,6,7,8,9,10] a_list = [x for x in reversed(a)] print(a_list) #运行结果 [10, 9, 8, 7, 6, 5, 4, 3, 2,