python——sorted()排序函数和round()函数
sorted()函数:
# sorted()默认为升序排列,reverse=True指定为降序排列
# sorted()函数可以对list,dict,array,tuple进行排序
# 例子:
# (1)排序字符串列表
# scores = ['A', 'B', 'C', 'D']
# scores = sorted(scores, reverse=True)
# 得:['D', 'C', 'B'...
原创
2018-12-29 16:01:21 ·
619 阅读 ·
0 评论