diff --git a/2023/day01/python/src/main.py b/2023/day01/python/src/part1.py similarity index 82% rename from 2023/day01/python/src/main.py rename to 2023/day01/python/src/part1.py index 065d99f..b067268 100644 --- a/2023/day01/python/src/main.py +++ b/2023/day01/python/src/part1.py @@ -1,13 +1,11 @@ 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): + if (char.isdigit()): value += int(char) * 10 ** index break;