21 lines
412 B
Python
21 lines
412 B
Python
|
#!/usr/bin/env python
|
||
|
# 2022 - Advent Of Code 1
|
||
|
|
||
|
# file = 'input_example.txt'
|
||
|
file = 'input.txt'
|
||
|
|
||
|
calories = []
|
||
|
with open(file, encoding="utf-8") as f:
|
||
|
accum = 0
|
||
|
for line in f.readlines():
|
||
|
if line == '\n':
|
||
|
# next elf
|
||
|
calories.append(accum)
|
||
|
accum = 0
|
||
|
else:
|
||
|
accum += int(line)
|
||
|
calories.append(accum)
|
||
|
|
||
|
print(calories)
|
||
|
print(max(calories))
|