PythiloMedium · 25 min · Task 60 of 100 · progress kept in this browser

Segment a word

Return whether text can be segmented into one or more nonempty dictionary words. The empty text is segmentable. Dictionary words are nonempty.

text = 'applepen'
reachable = 5
word = 'pen'
print(text.startswith(word, reachable))
Your task

Return whether text can be segmented into one or more nonempty dictionary words. The empty text is segmentable. Dictionary words are nonempty.