There is change lambda notation in python 3. I have used approch descibed in link.
http://stackoverflow.com/questions/2154249/identify-groups-of-continuous-numbers-in-a-list