mirror of
https://github.com/tanishq-dubey/aoc2023.git
synced 2025-01-01 02:27:22 -05:00
25 lines
298 B
Python
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
|