【发布时间】:2013-06-21 16:56:29
【问题描述】:
我已经尝试过像 Lambda、列表理解和其他的序列生成器,但似乎我无法得到我真正想要的东西。我的最终目标是从 string[1:3]
之类的字符串中打印单词序列我在寻找什么:
a = [0,13,26,39]
b = [12,25,38,51]
str = 'If you are done with the file, move to the command area across from the file name in the RL screen and type'
read = str.split()
read[0:12]
['If', 'you', 'are', 'done', 'with', 'the', 'file,', 'move', 'to', 'the', 'command', 'area']
read[13:25]
['from', 'the', 'file', 'name', 'in', 'the', 'RL', 'screen', 'and', 'type']
【问题讨论】:
-
嗯,有什么问题?
-
请问,您是在什么情况下发现这样的问题的?
标签: python string python-2.7