Slice a string in python (right, left, mid equivalents)

Python
import pandas as pd

Create some dummy data

string = '8754321'
string
'8754321'

#right 2 characters
string[-2:]
'21'

#left 2 characters
string[:2]
'87'

#4th through 6th characters (index starts at 0)
string[4:6]

'32'