From 4bc4482a1a2c2e5b652d1fd6163ef5d0b26365e7 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Thu, 2 Dec 2021 21:00:31 +0100 Subject: Specify file encoding --- 2021/01/puzzles.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to '2021/01') diff --git a/2021/01/puzzles.py b/2021/01/puzzles.py index d9a704b..0236559 100644 --- a/2021/01/puzzles.py +++ b/2021/01/puzzles.py @@ -1,10 +1,12 @@ #!/usr/bin/env python3 + def main() -> None: - with open("input", "r") as f: + with open("input", "r", encoding="utf-8") as f: nums = [int(n) for n in f.readlines()] print(sum(n < m for n, m in zip(nums, nums[DELTA:]))) + if __name__ == "__main__": main() -- cgit v1.2.3