def ranges(seq):
    start, end = seq[0], seq[0]
count = start
for item in seq:
    if not count == item:
        yield start, end
start, end = item, item
count = item
end = item
count += 1
yield start, end
print(list(ranges([1, 2, 3, 4, 5, 8, 9, 10, 11, 200, 201, 202])))
group list of ints by continuous sequence