From a31d20acf51be53de690d2b4a22c45f861522eb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marcos?= Date: Tue, 2 Oct 2018 05:57:19 -0300 Subject: [PATCH] Add GCD implementation (#371) --- Maths/gcd.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Maths/gcd.py diff --git a/Maths/gcd.py b/Maths/gcd.py new file mode 100644 index 000000000..0f0ba7dce --- /dev/null +++ b/Maths/gcd.py @@ -0,0 +1,12 @@ +def gcd(a, b): + if a == 0 : + return b + + return gcd(b%a, a) + +def main(): + print(gcd(3, 6)) + + +if __name__ == '__main__': + main()