For instance, I have a string like this:
my_string = 'a hello aaaaa hi aaaaaaa bye bbb' I want to change 'a' or 'a's to 'b'. So output I want is:
changed_string = 'b hello b hi b bye bbb' I tried use replace and then making multiple 'b's to single 'b', but then it would effect multiple 'b's that were originally in the string.
I don't want an answer like do the first n characters.
Any suggestions?