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.
+ 0 comments def mutate_string(string, position, character): return string[:position]+character+string[position+1:] if __name__ == '__main__': s = input() i, c = input().split() s_new = mutate_string(s, int(i), c) print(s_new)
+ 0 comments def mutate_string(string, position, character): l = list(string) l[int(i)] = c string = "".join(l) return string
if name == 'main': s = input() i, c = input().split() s_new = mutate_string(s, int(i), c) print(s_new)
+ 0 comments def mutate_string(string, position, character): l = list(string) l[position] = character string = "".join(l) return string
+ 0 comments def mutate_string(string, position, character): string = list(string) string[int(position)] = character string = "".join(string) return string s = input() i, c = input().split() s_new = mutate_string(s, int(i), c) print(s_new)
+ 0 comments x=input() y,z=input().split() k=int(y) x1=list(x) x1[k]=z print(''.join(x1))
Load more conversations
Sort 881 Discussions, By:
Please Login in order to post a comment