From 1dd6b6ac7aec7648d4b2701c8b8f887db8a800e2 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 20 Sep 2024 19:44:21 +0900 Subject: [PATCH] =?UTF-8?q?=EC=82=AC=EC=B9=99=EC=97=B0=EC=82=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- calculator.py | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/calculator.py b/calculator.py index 90f5426..544f099 100644 --- a/calculator.py +++ b/calculator.py @@ -1,31 +1,39 @@ def add(a, b): - pass + return a + b def subtract(a, b): - pass + return a - b def multiply(a, b): - pass + return a * b def divide(a, b): - pass + return a / b def pow(a, b): - pass + return a ** b def abs(a): - pass + if a < 0: + return -a + return a def mod(a, b): - pass + return a % b if __name__ == "__main__": - # 간단한 테스트 코드 - pass \ No newline at end of file + print(add(1,2)) + print(subtract(1,2)) + print(multiply(1,2)) + print(divide(1,2)) + print(pow(1,2)) + print(abs(-1)) + print(mod(1,2)) + \ No newline at end of file