I think that this question has been asked before, although I couldn't find an answer which fit with my query exactly.
I want to print certain elements from a list, depending on the length of an input. Example:
if anagramLength == 2:
print(words[0,5])
I found a think called 'operator.itemgetter', although this selects individual elements, where as I want it to select all from position 0 TO position 5 (not position 0 AND position 5).
Thanks!
words[0:5]?