aboutsummaryrefslogtreecommitdiff
path: root/2020/07/puzzle-2.py
diff options
context:
space:
mode:
Diffstat (limited to '2020/07/puzzle-2.py')
-rwxr-xr-x2020/07/puzzle-2.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/2020/07/puzzle-2.py b/2020/07/puzzle-2.py
index c87ea13..f77298a 100755
--- a/2020/07/puzzle-2.py
+++ b/2020/07/puzzle-2.py
@@ -8,11 +8,11 @@ def total_bags(innerbags: list[dict[int, str]]) -> int:
if innerbags[0]["name"] == "no other":
return 0
- return sum([bag["count"] + bag["count"] * total_bags(bdict[bag["name"]]) for bag in innerbags])
+ return sum(bag["count"] + bag["count"] * total_bags(bdict[bag["name"]]) for bag in innerbags)
def main() -> None:
- with open("input", "r") as f:
+ with open("input", "r", encoding="utf-8") as f:
lines = f.readlines()
for baginfo in lines: