notes:
index starts with 0, negative offset is added to the length of the string to derive a positive offset.
slicing s[:3] fetches items at offset 0 up to but not including 3
X[1:10:2] fetches every other item in X from offsets 1-9 with stride 2; it will collect items at offsets 1,3,5,7 and 9
strings can be converted between numeric types: int(S), float(S), str(1.234), str(1), repr(42), bin(13)
ord('s') can convert character to ASCII value, chr('115) is the reverse operation
s[0]='x' $ raises an error!
you need the following to replace:
s=s.replace('old', 'new')
s=s{:3]+'xx'+S[5:] # more powerful
build new text with formmating expressions
'That is %d %s bird!" % (1, 'beautiful')
'That is {0} {1} bird!'.format(1, 'beautiful')
Dictionary based formmating:
'%(qty)d more %(food)s' %{'qty':1, 'food':'spam'}
It is powerful when combined with vars() function
you can convert a string to a list, then making in place modifications
L=list(S)