Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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

string = 'pythonhxamples'
position = 6
new_character = 'e'

string = string[:position] + new_character + string[position+1:]
print(string)

#output: pythonexamples
Source by pythonexamples.org #
 
PREVIOUS NEXT
Tagged: #replace #positions #string #list #string #python
ADD COMMENT
Topic
Name
7+5 =