aoc2023/day1/main.py
2023-12-02 16:24:18 -05:00

25 lines
298 B
Python

data = []
with open('input') as f:
data = f.readlines()
total = 0
for d in data:
dstring = ''.join(filter(str.isdigit, d))
d1 = dstring[0]
d2 = dstring[-1]
print(d1, "-", d2)
total = total + int(f"{d1}{d2}")
print("=======")
print(total)
print("=======")
# Part 2