AdventOfCode/2021/day1/day1.py

20 lines
477 B
Python
Raw Permalink Normal View History

2023-12-09 22:01:20 +01:00
count = 0
grow = 0
with open('day1_data.txt') as f:
list_array = f.readlines()
for x in range(0,len(list_array),1):
if count != 0:
if int(list_array[count]) > int(list_array[count-1]):
grow += 1
print("Count: "+str(count)+"\t\t "+str(int(list_array[count]))+" ~ "+str(int(list_array[count-1]))+"\t\tGrow: "+str(grow))
count += 1
print("I count "+str(count)+" lines")
print("I found "+str(grow)+" depth measurement increases")