split then replace function python code example Example: update string in python var1 = 'Hello World!' print ("Updated String :- ", var1[:6] + 'Python')