diff --git a/02/02.py b/02/02.py index 4e9e73b..8145e1f 100644 --- a/02/02.py +++ b/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