blob: 8fddecffc73f0748a88417be3e51b9ae7c76a597 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
cur_cal = 0
max_cal = 0
with open("input", encoding="utf-8") as f:
foods = f.readlines()
for food in foods:
if food == "\n":
if cur_cal > max_cal:
max_cal = cur_cal
cur_cal = 0
else:
cur_cal += int(food)
print(f"highest calories is {max_cal}")
|