concept str.replace in category python

appears as: str.replace, str.replace
Tiny Python Projects: Learn coding and testing with puzzles and games

This is an excerpt from Manning's book Tiny Python Projects: Learn coding and testing with puzzles and games.

I asked earlier whether you could use str.replace() to change all the numbers. It turns out you cannot, because you’ll end up changing some of the values twice so that they end up at their original values.

Figure 8.3 The chained calls to str.replace() can be written as two separate statements if you prefer.