Thank-you very much for all the excellent replies. I'm thinking of using this to determine if a sequence is a "run" (as in a card game). If I've got a sorted hand [3, 4, 5, 6, 7], then I know I've got a 5-card run because [4, 5, 6, 7] - [3, 4, 5, 6] == [1, 1, 1, 1]. I want to avoid something like if h[0] == h[1]-1 and h[1] == h[2]-1 ...
Nick. -- http://mail.python.org/mailman/listinfo/python-list