摘要: #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 reverse... 阅读全文
posted @ 2019-06-17 15:30 持刀文人 阅读(4418) 评论(0) 推荐(0) 编辑