python change char in code example Example: python change character in string mytext = 'Hello Zorld' mytext = mytext.replace('Z', 'W') print mytext,