Correction: 2020.3.5
Normal writing
main.py
def euclid_algolithm_1(a, b):
while True:
r = a % b
if r == 0:
return b
a, b = b, r
Write in recursive representation
main.py
def euclid_algolithm_2(a, b):
r = a % b
if r == 0:
return b
return euclid_algorithm_2(b, r)
Recommended Posts