I'm trying to compare the second value in a list of tuples with the next second value and so on and so forth and return true every value is greater than the next. For example...
If each preceding value is greater than the next one, it would return True.
968854000 > 957946000 > 878825000 > 810870000 = True
list_of_tuples = [
('2018-09-30', 968854000),
('2017-09-30', 957946000),
('2016-09-30', 878825000),
('2015-09-30', 810870000)]
If not then return False.
968854000 > 957946000 !> 998825000 stop evaluation and return False
list_of_tuples = [
('2018-09-30', 968854000),
('2017-09-30', 957946000),
('2016-09-30', 998825000),
('2015-09-30', 810870000)]
I've tried the following and I feel like I'm on the right track but cannot wrap my head around it.
for i, j in enumerate(list_of_tuples):
date = j[0]
value = j[1]
if value > list_of_tuples[i+1][1]:
print(list_of_tuples[i+1][1])