From 76052fdcb9ebe8f15b3f580871db273c1e19b264 Mon Sep 17 00:00:00 2001 From: Oliver Akins Date: Sun, 25 Dec 2022 15:55:17 -0600 Subject: [PATCH] Add day 5 --- day_05/python/part1.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 day_05/python/part1.py diff --git a/day_05/python/part1.py b/day_05/python/part1.py new file mode 100644 index 0000000..794ac5d --- /dev/null +++ b/day_05/python/part1.py @@ -0,0 +1,10 @@ +stacks = {} +with open("test") as f: + for l in f: + if l == "\n": break + for i in range(len(l)): + if i % 4 == 1 and l[i] != " ": + s = i // 4 + if s not in stacks: stacks[s] = [] + stacks[s].append(l[i]) +print(stacks) \ No newline at end of file