Contact: aviboots(AT)netvision.net.il
39,890 questions
51,817 answers
573 users
def replace_character(s, idx, ch) : length = len(s) if (idx < 0 or idx > length) : return s s = list(s) s[idx] = ch return "".join(s) s = "python programming" s = replace_character(s, 7, 'G') print(s) ''' run: python Grogramming '''