EasyStringIndexPython solution refined