slightly better readability
This commit is contained in:
parent
2a6451876e
commit
95a3d5f8ee
4
02/02.py
4
02/02.py
|
@ -8,7 +8,9 @@ def part1(passwords):
|
|||
[policy, password] = entry.split(': ')
|
||||
[counts, character] = policy.split(' ')
|
||||
[minimum, maximum] = counts.split('-')
|
||||
if int(minimum) <= password.count(character) <= int(maximum):
|
||||
minimum = int(minimum)
|
||||
maximum = int(maximum)
|
||||
if minimum <= password.count(character) <= maximum:
|
||||
valid += 1
|
||||
return valid
|
||||
|
||||
|
|
Loading…
Reference in a new issue