From bdb2e4f95940f14f196350cec7a7231acd82ecda Mon Sep 17 00:00:00 2001 From: Chandana-23 <64766068+Chandana-23@users.noreply.github.com> Date: Tue, 5 May 2020 09:34:33 +0530 Subject: [PATCH] Update calc.py --- calc.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/calc.py b/calc.py index 5ebb7c6..402b85e 100644 --- a/calc.py +++ b/calc.py @@ -10,8 +10,11 @@ def mul(x, y): def div(x,y): return x/y def pow(x,y): - return x**y - + if y>1: + return x*pow(x,y-1) #If x,y are float numbers + if y<1: + m=y%1 + return x**m print("Select operation.") print("1.Add") print("2.Subtract")