As it stands it will do nothing unless
word
is already a declared list. Try:
word = [ "one","two","three"]
splits = [(word[:i], word[i:]) for i in range(len(word) + 1)]
splits
[([], ['one', 'two', 'three']), (['one'], ['two', 'three']), (['one', 'two'], ['three']), (['one', 'two', 'three'], [])]
deletes = [a + b[1:] for a, b in splits if b]
deletes
[['two', 'three'], ['one', 'three'], ['one', 'two']]
Take a look at
https://docs.python.org/2/tutorial/datastructures.html#list-comprehensions[
^] for more information on list comprehensions.