Q:

Write a Python function to insert a string in the middle of a string

0

Write a Python function to insert a string in the middle of a string

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

def insert_sting_middle(str, word):
	return str[:2] + word + str[2:]

print(insert_sting_middle('[[]]', 'Python'))
print(insert_sting_middle('{{}}', 'PHP'))
print(insert_sting_middle('<<>>', 'HTML'))

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now