Python’s `replace` string method substitutes occurrences of one substring with another. Call `text.replace(old, new)` to get a new string; the original remains unchanged because strings are immutable. An optional third argument limits the number of replacements. section 6.4.5
x = "Mississippi"
x.replace("ss", "+++")
'Mi+++i+++ippi'
Both occurrences of `ss` become `+++` in the returned string. section 6.4.5
Normalize before counting words
`moby = "There, now.".lower()`; then `moby = moby.replace(".", "").replace(",", "")`. Calling `moby.split()` now gives `['there', 'now']`. Reassign the result of each call: `replace` does not modify `moby` in place. section 21.2.2 section 6.4.5
Repeated calls are convenient for a few substitutions. For many punctuation characters, `translate` can handle them in one operation; looping over punctuation and calling `replace` for every line repeatedly creates new strings. For more powerful substring replacement, use the `re` module. section 21.2.2 section 6.10.2 section 6.4.5




