demo_ref_string_replace3.py:
txt = "one one was a race horse, two two was one too." x = txt.replace("one", "three", 2) print(x)
➜ begtut>python demo_string_replace3.py
three three was a race horse, two two was one too."