You are viewing a single comment's thread. Return to all comments →
def mutate_string(string, position, character): s_new = string[:position] + character + string[position+1:] return s_new
if name == 'main': s = input() i, c = input().split() s_new = mutate_string(s, int(i), c) print(s_new)
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
Mutations
You are viewing a single comment's thread. Return to all comments →
def mutate_string(string, position, character): s_new = string[:position] + character + string[position+1:] return s_new
if name == 'main': s = input() i, c = input().split() s_new = mutate_string(s, int(i), c) print(s_new)