From f85949f85266768ec1bd5e3d150e4ac71feabcf1 Mon Sep 17 00:00:00 2001 From: boredpasta Date: Mon, 13 Jan 2025 07:00:52 +0200 Subject: Add project files --- 2015/01/not_quite_lisp.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 2015/01/not_quite_lisp.py (limited to '2015/01/not_quite_lisp.py') diff --git a/2015/01/not_quite_lisp.py b/2015/01/not_quite_lisp.py new file mode 100644 index 0000000..d7c59d4 --- /dev/null +++ b/2015/01/not_quite_lisp.py @@ -0,0 +1,9 @@ +floor = 0 +with open("input", encoding="utf-8") as f: + text = f.read() +for char in text: + if char == '(': + floor += 1 + elif char == ')': + floor -= 1 +print(f"floor is {floor}") -- cgit v1.2.3