Files
AOC-2023/Day1/day1_p1.py
2023-12-01 17:37:57 +01:00

16 lines
335 B
Python

f = open("input.txt", "r")
tot = 0
for line in f.readlines() :
temp = 0
for c in line :
if c.isdigit() :
temp = int(c) * 10
for d in line[::-1] :
if d.isdigit() :
temp += int(d)
break
break
tot += temp
print(tot)
f.close()