Find Longest Consecutive Substring In Python