From 95a3d5f8ee44af758a3e9efcd1c417289efd4630 Mon Sep 17 00:00:00 2001 From: trwnh Date: Wed, 2 Dec 2020 09:48:56 -0600 Subject: [PATCH] slightly better readability --- 02/02.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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