Here’s an example of a function that utilizes recursion:
def multiply(a, b):
#takes two integers and multiplies them
if b == 0:
return 0
else:
return a + multiply(a, b-1)
def multiply(a, b):
#takes two integers and multiplies them
if b == 0:
return 0
else:
return a + multiply(a, b-1)
by QWERTY mnbvcxz February 14, 2019