init day00 python

This commit is contained in:
starnakin 2023-12-01 12:56:27 +01:00
commit dd834665e5
4 changed files with 17 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
**/input.txt

1
2023/day01/python/run.sh Executable file
View File

@ -0,0 +1 @@
python3 main.py

View File

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

0
README.md Normal file
View File