You are viewing a single comment's thread. Return to all comments →
def mutate_string(string, position, character): return s[:int(i)] + str(c) + s[int(i)+1:]
if name == 'main': s = input() i, c = input().split() s_new = mutate_string(s, int(i), c) print(s_new)
I've used python 3.
Seems like cookies are disabled on this browser, please enable them to open this website
Mutations
You are viewing a single comment's thread. Return to all comments →
def mutate_string(string, position, character): return s[:int(i)] + str(c) + s[int(i)+1:]
if name == 'main': s = input() i, c = input().split() s_new = mutate_string(s, int(i), c) print(s_new)
I've used python 3.