我已经尝试过像 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']