From fa4f8b9d0934f9875af740eda1931c1ad24a4162 Mon Sep 17 00:00:00 2001 From: Yeshwanth Reddy <129676151+yashtachi@users.noreply.github.com> Date: Tue, 15 Oct 2024 22:31:39 +0530 Subject: [PATCH] Update 31_calculator.py Added integer division and reminder functions to look more like a Basic professional calculator --- 6-functions/31_calculator.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/6-functions/31_calculator.py b/6-functions/31_calculator.py index 22b7db1..e63fb00 100644 --- a/6-functions/31_calculator.py +++ b/6-functions/31_calculator.py @@ -13,6 +13,12 @@ def multiply(a, b): def divide(a, b): return a / b +def int_divide(a, b): + return a // b + +def reminder(a, b): + return a % b + def exp(a, b): return a ** b @@ -20,4 +26,6 @@ def exp(a, b): print(subtract(7, 2)) print(multiply(4, 8)) print(divide(9, 3)) +print(int_divide(10,3)) +print(reminder(50,3)) print(exp(2, 3))