From b190c8f629d1fb8371fb9ea434d986a843b2ecab Mon Sep 17 00:00:00 2001 From: Aliabbas Merchant Date: Tue, 15 Oct 2019 00:05:51 +0530 Subject: [PATCH] Rename GCD File (#1354) --- ...greater_common_divisor.py => greatest_common_divisor.py} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename maths/{greater_common_divisor.py => greatest_common_divisor.py} (76%) diff --git a/maths/greater_common_divisor.py b/maths/greatest_common_divisor.py similarity index 76% rename from maths/greater_common_divisor.py rename to maths/greatest_common_divisor.py index ec608488a..ebc08f37f 100644 --- a/maths/greater_common_divisor.py +++ b/maths/greatest_common_divisor.py @@ -1,12 +1,12 @@ """ -Greater Common Divisor. +Greatest Common Divisor. Wikipedia reference: https://en.wikipedia.org/wiki/Greatest_common_divisor """ def gcd(a, b): - """Calculate Greater Common Divisor (GCD).""" + """Calculate Greatest Common Divisor (GCD).""" return b if a == 0 else gcd(b % a, a) @@ -16,9 +16,9 @@ def main(): nums = input("Enter two Integers separated by comma (,): ").split(",") num_1 = int(nums[0]) num_2 = int(nums[1]) + print(f"gcd({num_1}, {num_2}) = {gcd(num_1, num_2)}") except (IndexError, UnboundLocalError, ValueError): print("Wrong Input") - print(f"gcd({num_1}, {num_2}) = {gcd(num_1, num_2)}") if __name__ == "__main__":