slice argument for string python code example
Example 1: string slicing in python 3 arguments
#[start:end:step]
>>> range(10)[::2]
[0, 2, 4, 6, 8]
Example 2: how to slice a string in python
a = 'hello'
print(a[1:2])
#[start:end:step]
>>> range(10)[::2]
[0, 2, 4, 6, 8]
a = 'hello'
print(a[1:2])