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