Files
Learn-Python-Programming-Th…/ch05/functions.py
T
adii1823 ef37ce0c4e ch05
2021-10-28 17:38:16 +05:30

8 lines
146 B
Python

# functions.py
def gcd(a, b):
"""Calculate the Greatest Common Divisor of (a, b). """
while b != 0:
a, b = b, a % b
return a