fi = open("in.txt", "r") lst = [] tempLi = [] for li in fi.readlines(): if not li == "\n": tempLi.append(int(li)) if li == "\n": lst.append(tempLi) tempLi = [] su = map(sum, lst) print(f"part 1: {max(su)}") sumList = [num for num in map(sum, lst)] sumList.sort(reverse=True) print(f"part 2: {sumList[0] + sumList[1] + sumList[2]}")