adventOfCode/2023/1/part1.py
2023-12-02 10:46:52 +01:00

4 lines
No EOL
199 B
Python

import re
numbers = [(int(re.match(r".*?(\d)", x)[1]) * 10 + int(re.match(r"(?:.*)(\d)", x)[1])) for x in open("input3", "r") if re.match(r".*?\d+", x) is not None]
print(sum(numbers))
print(numbers)