""" Purpose: consider string replace() functions """ # Get text, search string, and replacement string text = input( "Enter text: " ) s = input( "Enter substring (s): " ) r = input( "Enter substring (r): " ) print() # Get version of text with occurrences of s replaced with r modified_text = text.replace( s, r ) # Print substitution print( "text.replace( s, r ):", modified_text, " # text's s's replaced with r's" )