def replace_char(string, pos, new_char):
    ' Create new string with character at :pos: changed to :new_char:. '
    if (pos < 0):
        pos = (len(string) + pos)
    return ((string[:pos] + new_char) + string[(pos + 1):])
Create new string with character at :pos: changed to :new_char:.
def replace_char(string, pos, new_char):
    '  '
    if (pos < 0):
        pos = (len(string) + pos)
    return ((string[:pos] + new_char) + string[(pos + 1):])