nth substring occurance using itertools
I am trying to write a function that returns a string with the nth substring replaced by a new substring:
I am trying to write a function that returns a string with the nth substring replaced by a new substring: