In [21]: obj[re.split('\.', txt, 1)[0]] Out[21]: ['Assume formlessness', 'Those who know do not speak, those who speak do not know'] In [22]: obj[re.split('\.', txt, 1)[0]][1] Out[22]: 'Those who know do not speak, those who speak do not know' In [23]: obj[re.split('\.', txt, 1)[0]][0] Out[23]: 'Assume formlessness' In [24]: obj[re.split('\.', txt, 1)[0]][re.split('\.', txt, 1)[1]] --------------------------------------------------------------------------- TypeError Traceback (most recent call last) in ----> 1 obj[re.split('\.', txt, 1)[0]][re.split('\.', txt, 1)[1]] TypeError: list indices must be integers or slices, not str In [25]: obj[re.split('\.', txt, 1)[0]][int(re.split('\.', txt, 1)[1])] Out[25]: 'Those who know do not speak, those who speak do not know'