>>> s = 'abcdefgh'
>>> n, m, char, chars = 2, 3, 'd', 'cd'
>>> 
>>> s[n-1:n+m-1]
'bcd'
>>> 
>>> s[n-1:]
'bcdefgh'
>>> 
>>> s[:-1]
'abcdefg'
>>> 
>>> indx = s.index(char)
>>> s[indx:indx+m]
'def'
>>> 
>>> indx = s.index(chars)
>>> s[indx:indx+m]
'cde'
>>>