Most "pythonic" way to do this?
what's the most "pythonic" way to calculate if a list of list has each
element greater than its neigbbour? eg
a = [[3.1, 3.13], [3.14, 3.12], [3.12, 3.1]]
I want to see if the first element in each of the list (inside the bigger
list) is greater than the 2nd element. So for first item, its false
because 3.1 < 3.13. 2nd and 3rd item is true.
I can most certainly use a for loop, but would like to see alternative
approaches. thanks.
No comments:
Post a Comment