HackerRank- Python Mutations
Read a given string, change the character at a given index and then print the modified string.
- def mutate_string(string, position, character):
-
- a=list(string)
- a[position]= character
- string=''.join(a)
-
- return string
-
- if __name__ == '__main__':
- s = input()
- i, c = input().split()
- s_new = mutate_string(s, int(i), c)
- print(s_new)