In python how to get a substring of a string?