|
123456789101112131415161718 |
- def main():
- """ For each depth in the list, determine whether it's deeper than the previous depth.
- There is no previous depth for the first entry.
- Output the total number of times the depth increased.
- """
- with open("aoc1-1.txt", "r") as file:
- depths = file.readlines()
- depths = [int(el.strip()) for el in depths]
- prev = 999999999
- increases = []
- for depth in depths:
- increases.append(1 if depth > prev else 0)
- prev = depth
- print(sum(increases))
-
-
- if __name__ == "__main__":
- main()
|