Notes#
- Today, I learned about recursion. Recursion means calling oneself. Generally, it refers to the part in a function where it calls itself.
- This concept is quite challenging and requires more practice.
- Today's coding exercise is to write a factorial function.
CODE#
print("What Is Recursion?")
def reverse(value):
if value <= 0:
print("DONE!")
return 1
else:
factorial = value * reverse(value - 1)
return factorial
num = int(input("NUM ? > "))
print(reverse(num))