replace by positions a string in a list with another string python

Solutions on MaxInterview for replace by positions a string in a list with another string python by the best coders in the world

showing results for - "replace by positions a string in a list with another string python"
Cornelia
24 Nov 2018
1string = 'pythonhxamples'
2position = 6
3new_character = 'e'
4
5string = string[:position] + new_character + string[position+1:]
6print(string)
7
8#output: pythonexamples