gcd.py

Created by numworks-en

Created on March 04, 2020

84 Bytes

This script defines a function gcd(a,b) which returns the greatest common divisor of a and b.


def gcd(a,b):
    while (b>0):
        r=a%b
        a,b=b,r
    return a