rename main to part1

This commit is contained in:
starnakin 2023-12-01 13:30:16 +01:00
parent 0337e63d9f
commit a2b8f6544b

View File

@ -1,13 +1,11 @@
text: str = open("input.txt", "r").read() text: str = open("input.txt", "r").read()
import string
value: int = 0 value: int = 0
for line in text.split("\n"): for line in text.split("\n"):
for index, chars in enumerate([line[::-1], line]): for index, chars in enumerate([line[::-1], line]):
for char in chars: for char in chars:
if (char in string.digits): if (char.isdigit()):
value += int(char) * 10 ** index value += int(char) * 10 ** index
break; break;