From 74636f797b02bb26a189aea11d5ae0c707514f6f Mon Sep 17 00:00:00 2001 From: komalpasumarthy <92156651+komalpasumarthy@users.noreply.github.com> Date: Sat, 18 Feb 2023 04:36:16 +0530 Subject: [PATCH 1/3] Update addition.py --- addition.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addition.py b/addition.py index e184760..0531013 100644 --- a/addition.py +++ b/addition.py @@ -2,6 +2,6 @@ num2 = int(input("Enter second number: ")) # addition -result = num1 * num2 +result = num1 + num2 print("The sum of", num1, "and", num2, "is", result) From 868e515a30ad75f7c92d147e67350144b8d22e63 Mon Sep 17 00:00:00 2001 From: komalpasumarthy <92156651+komalpasumarthy@users.noreply.github.com> Date: Sat, 18 Feb 2023 04:39:48 +0530 Subject: [PATCH 2/3] Update gcd.py --- gcd.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/gcd.py b/gcd.py index 3c39d8d..0816879 100644 --- a/gcd.py +++ b/gcd.py @@ -2,6 +2,22 @@ num2 = int(input("Enter second number: ")) # greatest common divisor -result = num1 + num2 - +def gcd(a, b): + + # Everything divides 0 + if (a == 0): + return b + if (b == 0): + return a + + # base case + if (a == b): + return a + + # a is greater + if (a > b): + return gcd(a-b, b) + return gcd(a, b-a) + +result = gcd(num1, num2) print("The GCD of", num1, "and", num2, "is", result) From 079f26216bc7a5be906428006be38d2b8e76d27e Mon Sep 17 00:00:00 2001 From: komalpasumarthy <92156651+komalpasumarthy@users.noreply.github.com> Date: Sat, 18 Feb 2023 04:44:27 +0530 Subject: [PATCH 3/3] Update simple_interest.py --- simple_interest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simple_interest.py b/simple_interest.py index 88d4325..ff86fa5 100644 --- a/simple_interest.py +++ b/simple_interest.py @@ -3,6 +3,6 @@ time = float(input("Enter the number of years for the investment: ")) # Simple Interest Calculation -interest = (principal * rate * time) +interest = (principal * rate * time)/100 print("The simple interest for an investment of", principal, "at", rate, "% for", time, "years is:", interest)