So many nuances with string methods :)
The str.replace() method takes an optional count argument so you for example can only replace the first match:
>>> s = "hello world, hello again"
>>> s.replace("hello", "bye")
'bye world, bye again'
>>> s.replace("hello", "bye", 1)
'bye world, hello again'