AdventOfCode/2022/day1/day1_part1.py

20 lines
353 B
Python
Raw Normal View History

2023-12-09 22:06:15 +01:00
with open('input') as f:
list_array = f.readlines()
sun_array = []
count = 0
temp = 0
max = 0
for x in list_array:
if x != '\n':
temp += int(x)
else:
print('total: ' + str(temp))
if temp > max: max = temp
temp = 0
print('total: ' + str(temp))
print('The Elf with the most Calories carry ' + str(max))