@dataslayer86890: Oh well, this is interesting.
The thing with islice is that it works this way:
isclie(): elements from the sequence[start:stop:step]
#islice('ABCDEFG', 2, None) --> C D E F G
So what happens? You pass your strings to text and word, split them (creating two separate lists) and you try to check if the element stored in the wo_rd is equal to that islice statement.
But the problem is that islice() is an iterator not a generator.
You're trying to compare a value with this "itertools.islice object at 0x1e99898"
I don't believe you'll be able to get values from it unless you do something truly "high level in Python"
That's why your output was always the same, the condition was always false.
I, personally, can't see a way to make it work with islice() but the way you did spliting the strings and turning into lists, is correct.
Hopefully someone who has far more knowledge than me in Python will show up and also check if there's a solution for it.