1def strictly_increasing(L):
2 return all(x<y for x, y in zip(L, L[1:]))
3
4def strictly_decreasing(L):
5 return all(x>y for x, y in zip(L, L[1:]))
6
7def non_increasing(L):
8 return all(x>=y for x, y in zip(L, L[1:]))
9
10def non_decreasing(L):
11 return all(x<=y for x, y in zip(L, L[1:]))
12
13def monotonic(L):
14 return non_increasing(L) or non_decreasing(L)
15