Contact: aviboots(AT)netvision.net.il
39,990 questions
51,935 answers
573 users
s = 'abc def ghi jkl' index = s.find('ghi') s = s[:index] + 'XYZ ' + s[index:] print(s) ''' run: abc def XYZ ghi jkl '''
s = 'abc def ghi jkl' lst = s.split() lst.insert(2, 'XYZ') s = ' '.join(lst) print(s) ''' run: abc def XYZ ghi jkl '''