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