Codewars | Python | Range Extraction Solution