String replacement
S = 'spammy' S = S.replace('mm', 'xx') print S print 'aa$bb$cc$dd'.replace('$', 'SPAM')