diff --git a/Mathematics/euclidean_algo_GCD_basic.py b/Mathematics/euclidean_algo_GCD_basic.py new file mode 100644 index 000000000..1a1cd6987 --- /dev/null +++ b/Mathematics/euclidean_algo_GCD_basic.py @@ -0,0 +1,11 @@ +# Python program to demonstrate Basic Euclidean Algorithm +# Function to return gcd of a and b +def gcd(a, b): + if a == 0 : + return b + return gcd(b%a, a) + +# example with 2 numbers which could be taken as input also +a = 10 +b = 15 +print(gcd(a, b))