advent_of_code/2021/1/1.py

17 lines
332 B
Python
Raw Permalink Normal View History

2021-12-06 01:27:38 +01:00
#!/usr/bin/env python
2021-12-12 17:23:29 +01:00
# 2021 - Advent Of Code 1
2021-12-06 01:27:38 +01:00
count = 0
2022-04-05 13:27:24 +02:00
with open('input.txt', encoding="utf-8") as f:
2021-12-06 01:27:38 +01:00
previous_value = int(f.readline())
for line in f:
current_value = int(line)
if current_value > previous_value:
count += 1
previous_value = current_value
print(f'count: {count}')