Add day 5
This commit is contained in:
parent
45a037d56e
commit
76052fdcb9
1 changed files with 10 additions and 0 deletions
10
day_05/python/part1.py
Normal file
10
day_05/python/part1.py
Normal file
|
|
@ -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)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue