We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
def mutate_string(string, position, character):
s = string
i = position
c = character
list(s)
return s[:i] + c + s[i+1:]
if __name__ == '__main__':
s = input()
i, c = input().split()
s_new = mutate_string(s, int(i), c)
print(s_new)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
def mutate_string(string, position, character): string=list(string) string[position]=character string="".join(string) return string
if name == 'main': s = input() i, c = input().split() s_new = mutate_string(s, int(i), c) print(s_new)