I think the mid function returns a part of a string. In python, you can consider a string as a list of characters and use the [] notation to get slices. See this tutorial on
Python string handling or some simple code:
>>> s = "Hello World!"
>>> s[0]
'H'
>>> s[0:5]
'Hello'
>>> s[:5]
'Hello'
>>> s[6:13]
'World!'
>>> s[6:]
'World!'
>>> s[-1]
'!'