# Created on savesnippets.com ยท https://savesnippets.com/78WcaB74sQTEXg from itertools import pairwise # Compute deltas between consecutive readings readings = [10, 13, 12, 18, 22] deltas = [b - a for a, b in pairwise(readings)] print(deltas) # [3, -1, 6, 4] # Validate that a list is strictly increasing def is_increasing(xs): return all(a < b for a, b in pairwise(xs)) print(is_increasing([1, 2, 5, 10])) # True print(is_increasing([1, 2, 2, 5])) # False