Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bslatkin/effectivepython
/ index_words
Function
index_words
example_code/item_043.py:51–58 ·
view source on GitHub ↗
(text)
Source
from the content-addressed store, hash-verified
49
50
print(
"Example 1"
)
51
def
index_words(text):
52
result = []
53
if
text:
54
result.append(0)
55
for
index, letter in enumerate(text):
56
if
letter ==
" "
:
57
result.append(index + 1)
58
return
result
59
60
61
print(
"Example 2"
)
Callers
1
item_043.py
File · 0.85
Calls
1
append
Method · 0.45
Tested by
no test coverage detected