标签:ISE 列表 col play scores 排序 组元 style pre
>>> import bisect >>> scores = [(100, ‘perl‘), (200, ‘tcl‘), (400, ‘lua‘), (500, ‘python‘)] >>> bisect.insort(scores, (300, ‘ruby‘)) >>> scores [(100, ‘perl‘), (200, ‘tcl‘), (300, ‘ruby‘), (400, ‘lua‘), (500, ‘python‘)]
python 在列表中添加元组元素,按照元组第一个值进行排序
标签:ISE 列表 col play scores 排序 组元 style pre
原文地址:https://www.cnblogs.com/sea-stream/p/10028410.html