advent_of_code/2021/1/1.py
kleph 9598e8f526
All checks were successful
continuous-integration/drone/push Build is passing
archive AoC 2021
2022-11-30 02:08:02 +01:00

16 lines
332 B
Python
Executable file

#!/usr/bin/env python
# 2021 - Advent Of Code 1
count = 0
with open('input.txt', encoding="utf-8") as f:
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}')