string(i:i + k) in python code example Example: in python [:-1] >>> L = range(10) >>> L[::2] [0, 2, 4, 6, 8]