Im currently on a python and I have the following problem: I have a list with bout a 1000 entries(int) lookk like this):
list = [593, 602, 608, 623, 632, 644, 644, 616, 589, 563, 583, 613, 660, 698, 728, 769, 815, 859, 885, 909, 931, 944, 960, 974, 986, 985, 986, 987, 990, 990, 993, 999, 1008, 1020, 1035, 1051, 1061, 1068]
and so on... i want to check if the first value is smaller than the second value, like this:
list = [593 < 603, 608 < 623, 632 < 644, ... < ..., ... < ..]
Everytime its smaller i want to add 1 to my total, like this:
total = 0
total += 1
All in all i want the answers in boolean. I want to know how often its true or false like: true: 31 false: 2
Full code:
list = []
with open("data.txt") as data:
data = [int(line.strip()) for line in data]
def funcAOC2():
total = 0
for i in range(0, len(data) - 2, 1):
value = int(data[i] + data[i + 1] + data[i + 2])
list.append(value)
print(list)
Thanks for your time. :)