I have a 2d List
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']]
Is there an easy way to get a range of values from this list?
if I write:
print a[0][0]
I get 'Turn', but is there a way to slice multiple things out of the list and make a new list? If I have a value i=0 and n=2 I am looking to make a new list that starts at a=[i][n] and makes a new list with the list items on either side of that index.
Thanks for the help