From cc4c73fcc1716f062e6d18d2abdef0088be8764e Mon Sep 17 00:00:00 2001 From: mgardzinski Date: Fri, 5 Apr 2024 11:35:29 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Added=20`root=5Fsquare`=20function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- calculator/calculator.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/calculator/calculator.py b/calculator/calculator.py index 7e52000..fab219c 100644 --- a/calculator/calculator.py +++ b/calculator/calculator.py @@ -1,3 +1,6 @@ +import math + + def add(x, y): """Returns the sum of x and y.""" return x + y @@ -24,3 +27,8 @@ def subtract(x, y): def exponentiate(x, y): """Returns x raised to the power of y.""" return x**y + + +def root_square(x): + """Returns the square root of x.""" + return math.sqrt(x)