blob: 73e7d9ce291bd13ee50dc461263c59fbcf9bae29 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
def gcd(p,q):
"""Docstring gcd"""
if p < q:
(p,q) = (q,p)
if(p%q) == 0:
return q
else:
return (gcd(q, p % q)) # recursion taking place
# calling function with parameters and printing it out
print(gcd(8,12))
|