string_manipulation_updating.py


Sign up Free. Don't forget to check out our challenges, lessons, solve and learn series and more ...


Code Snippet

name="Mr Moose"
#from the specified index number, in this case 2, replace the rest of the string with "Python"
new_name=name[:2] + " Python"
print(new_name)



                    

Try it yourself