syntax: string[start:stop]
stop not included
В срезах последний индекс игнорируется
string[start:stop:step]
string[::2] from start with one step
string[::-1] it will show revered string!!!
len(s) - 1 # amount of symbols
len(s) - 1 # amount of symbols
s[len(s) - 1] # show last sym right away
"panda"[3] # we can use index ra in strings
# How to mutate the inmutable string
s = 'hello python'
s2 = "H" + s[1:]
Reference:
- Добрый Python. Балакирев