What is the most "pythonic" way to calculate if a list list has each item larger 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 larger list) is larger than the 2nd element. So, for the first element its false, because 3.1 <3,13. 2nd and 3rd positions are correct.
I can certainly use a for loop, but would like to see alternative approaches. thanks.
source share