''' Purpose: consider string replace() functions ''' 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 ) # replace( x, y ) # x is the substring we want to replace # y is the substring we want to take the place of x # look for all characters in s in the string text, then replace them with the characters in r # looks for s EXACTLY! # if r is an empty string '' --> puts 'nothing' where all of s is print( "text.replace( s, r ):", modified_text, " # text's s's replaced with r's" )