diff options
author | Thomas Voss <thomasvoss@live.com> | 2021-12-02 21:00:31 +0100 |
---|---|---|
committer | Thomas Voss <thomasvoss@live.com> | 2021-12-02 21:00:31 +0100 |
commit | 4bc4482a1a2c2e5b652d1fd6163ef5d0b26365e7 (patch) | |
tree | 863fe5aa3eaef4a22246aef7f1d319726f9784cf /2021 | |
parent | e4ba18a5f54218a7f86a988ecf8afc78e548d0a4 (diff) |
Specify file encoding
Diffstat (limited to '2021')
-rw-r--r-- | 2021/01/puzzles.py | 4 |
1 files changed, 3 insertions, 1 deletions
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() |