DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
how to replace a character from a string from a index
stra = 'Meatloaf' posn = 5 nc = 'x' stra = string[:posn] + nc + string[posn+1:] print(stra)
Source by www.delftstack.com #
PREVIOUS
NEXT
Tagged:
#replace
#character
#string
#index
ADD COMMENT
Topic
COMMENT
Name
8+2 =
Submit