Poti sa ii pasezi ce caractere vrei tu, nu doar "^".
def insert_after_vowels(string, characters):
vowels = "aeiouAEIOU"
result = string
for vowel in vowels:
left = 0
while True:
vowel_position = result.find(vowel, left, len(result))
if vowel_position != -1: # 'vowel' found in 'string'
left = vowel_position + len(characters)
result = result[:vowel_position + 1] + characters + result[vowel_position + 1:]
else:
break # 'vowel' not found in 'result'
return result
if __name__ == "__main__":
sentence = input("Enter sentence: ")
print(insert_after_vowels(sentence, "^^^"))