Getting part of a string

>>>mystr = "abcdefghijkl"
>>>mystr[-4:]
'ijkl'

Did this page help you?