add: Day1

This commit is contained in:
2023-12-01 17:37:57 +01:00
commit b7fe041a21
3 changed files with 1045 additions and 0 deletions

16
Day1/day1_p1.py Normal file
View File

@@ -0,0 +1,16 @@
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()