【发布时间】:2015-04-07 18:22:58
【问题描述】:
如您所知,我在命名问题的标题时遇到了困难。无论如何,将问题置于某些上下文中:我有一个高分文本文件,数据已放入列表中。每个人的分数已经过排序,所以他们现在从低到高排序。
data = [['Stuart', 'got', 'a', 'highscore', 'of:', '92'], [ 'Steve',
'got', 'a', 'highscore', 'of:', '53'], ['Andrew', 'got', 'a',
'highscore', 'of:', '73'], ['Luke', 'got', 'a', 'highscore',
'of:', '1'], [ 'Shaney', 'got', 'a', 'highscore', 'of:', '77'],
['Robert', 'got', 'a', 'highscore', 'of:', '33'], ['Moley',
'got', 'a', 'highscore', 'of:', '6'], [ 'Kev', 'got', 'a',
'highscore', 'of', '2322']]
numbers = [1, 6, 33, 53, 73, 77, 92, 2322]
temp = []
我的目标是创建一个名为“temp”的列表,其中包含 有序数据。 “有序数据”将是原始日期,但经过安排,['Luke', 'got', 'a', 'highscore', 'of:', '1'] 将位于“临时”列表的开头。
像往常一样,任何可以帮助我的反馈都将不胜感激。
【问题讨论】:
标签: python list indexing int append