Files
AdventOfCode2023/01/01-1.py
2023-12-02 12:18:07 +01:00

19 lines
351 B
Python

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
input_file = open("input-org", "r")
summe = 0
for line in input_file:
v1, v2 = "", ""
line = line.strip()
for b in line:
if b.isdigit() and v1 == "":
v1 = b
if b.isdigit() and v1 != "":
v2 = b
summe += int(v1+v2)
input_file.close()
print(summe)