From a2b8f6544bf0620f299cc9d6b7aa4bcbcdfa750c Mon Sep 17 00:00:00 2001 From: starnakin Date: Fri, 1 Dec 2023 13:30:16 +0100 Subject: [PATCH] rename main to part1 --- 2023/day01/python/src/{main.py => part1.py} | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) rename 2023/day01/python/src/{main.py => part1.py} (82%) 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;