1>>> x = "Hello World!"
2>>> x[2:]
3'llo World!'
4>>> x[:2]
5'He'
6>>> x[:-2]
7'Hello Worl'
8>>> x[-2:]
9'd!'
10>>> x[2:-2]
11'llo Worl'
1# string [start:end:step]
2string = "freeCodeCamp"
3print(string[0:len(string)-1]) # freeCodeCam
4print(string[0:5]) # freeC
5print(string[2:6]) # eeCo
6print(string[-1]) # p
7print(string[-5:]) # eCamp
8print(string[1:-4]) # reeCode
9print(string[-5:-2]) # eCa
10print(string[::2]) # feCdCm