私は2次元リストを持っています
a= [['Turn', 'the', 'light', 'out', 'now'], ['Now', ',', 'I', 'll', 'take', 'you', 'by', 'the', 'hand'], ['Hand', 'you', 'anoth', 'drink'], ['Drink', 'it', 'if', 'you', 'can'], ['Can', 'you', 'spend', 'a', 'littl', 'time'], ['Time', 'is', 'slip', 'away'], ['Away', 'from', 'us', ',', 'stay'], ['Stay', 'with', 'me', 'I', 'can', 'make'], ['Make', 'you', 'glad', 'you', 'came']]
このリストから値の範囲を取得する簡単な方法はありますか?
私が書く場合:
print a[0][0]
「ターン」と出ますが、リストから複数のものを切り出して新しいリストを作る方法はありますか?値が i=0 で n=2 の場合、a=[i][n] で始まる新しいリストを作成し、そのインデックスの両側にリスト アイテムを含む新しいリストを作成しようとしています。
助けてくれてありがとう