Sep-05-2019, 03:52 PM
def euclidean(a, b): if b==0: return a return euclidean(b, a%b)It works to give these results:
print(euclidean(8, 6))# 2 print(euclidean(25, 5))# 5 print(euclidean(49, 14))# 7I am trying to understand recursion, but I can't understand the return (3rd line) here, and how it makes this function work. I would really appreciate a breakdown so I can follow what's going on at each step. Thank you for any help you can provide!!