MCPcopy Create free account
hub / github.com/bslatkin/effectivepython / index_words_iter

Function index_words_iter

example_code/item_043.py:69–74  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

67
68print("Example 3")
69def index_words_iter(text):
70 if text:
71 yield 0
72 for index, letter in enumerate(text):
73 if letter == " ":
74 yield index + 1
75
76
77print("Example 4")

Callers 1

item_043.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected