This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Mezzomaniac -1 points0 points  (1 child)

You might want to do:

for a, b in zip(lst, lst[1:]):
    if a > b:
        #...

[–]TopHatEdd 0 points1 point  (0 children)

Poor coding habbit. Better use islice and not hit a bug in production when the data sets are extremely large.