diff --git a/ch05-files/e18b2_sum_mult_columns.py b/ch05-files/e18b2_sum_mult_columns.py index f05e8f0..b64b397 100755 --- a/ch05-files/e18b2_sum_mult_columns.py +++ b/ch05-files/e18b2_sum_mult_columns.py @@ -13,12 +13,7 @@ def sum_mult_columns(filename): first, second = fields - if not first.isdigit(): - continue - - if not second.isdigit(): - continue - - total += int(first) * int(second) + if all(i.isdigit() for i in fields): + total += int(first) * int(second) return total