4 ms·
Indeed: all(a < b for a,b in zip(seq,seq[1:])) (Although one might want <= if checking to see if the sequence is sorted, rather than strictly ascending (t
by e12e 12y ago
Indeed:
all(a < b for a,b in zip(seq,seq[1:]))
(Although one might want <= if checking to see if the sequence is sorted, rather than strictly ascending (that is, it can contain matching/repeated elements)).