renamed 2 digit file names
This commit is contained in:
parent
018011dd27
commit
b4d985a55a
44 changed files with 0 additions and 0 deletions
14
2018/02/part1.py
Normal file
14
2018/02/part1.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
with open('input.txt') as input:
|
||||
lines = [line.strip('\n') for line in input.readlines()]
|
||||
two = 0
|
||||
three = 0
|
||||
for line in lines:
|
||||
for char in 'qwertyuiopasdfghjklzxcvbnm':
|
||||
if line.count(char) == 2:
|
||||
two += 1
|
||||
break
|
||||
for char in 'qwertyuiopasdfghjklzxcvbnm':
|
||||
if line.count(char) == 3:
|
||||
three += 1
|
||||
break
|
||||
print(two, three, two * three)
|
Loading…
Add table
Add a link
Reference in a new issue