You can use regex. Here is an example:
import re
s="welcome"
new_s = re.sub('([aeiou])', '\g<1>p\g<1>', s)
print(new_s)
> wepelcopomepe
2
solved Python inserting characters in strings next to a specefic letters
You can use regex. Here is an example:
import re
s="welcome"
new_s = re.sub('([aeiou])', '\g<1>p\g<1>', s)
print(new_s)
> wepelcopomepe
2
solved Python inserting characters in strings next to a specefic letters