aoc/2023/01/part1.py

16 lines
291 B
Python
Raw Normal View History

2023-12-20 19:31:01 +00:00
#!/usr/bin/env python3
import os
path = os.path.dirname(os.path.abspath(__file__))
nums = []
with open(path+'/filtered.txt', 'r') as input:
for text in input.readlines():
a = int(text[0])
b = int(text[-2])
nums.append((10*a) + b)
print(nums)
print(sum(nums))