String is Hello.world.hello. I wanted to replace the second occurrence of the dot with '_'.
str = "Hello. world. Hello!"
x = re.sub(r'^((.){1}).', r'\1_', str)
#x = str.find(str.find('.')
print(x)
The output I am getting is 'H_llo. world. Hello!'. What should be the correct solution