How to check if a list is not increasing in Python

1 Answer

0 votes
def not_increasing(lst):
    return all(x >= y for x, y in zip(lst, lst[1:]))
    
lst = [89, 70, 44, 32, 25, 19, 18, 7, 5, 3, 1]

print(not_increasing(lst))




'''
run:

True

'''

 



answered Feb 22, 2024 by avibootz

Related questions

1 answer 154 views
1 answer 109 views
1 answer 150 views
1 answer 107 views
1 answer 162 views
1 answer 180 views
...