Answers
>
Python
>
Mentoring
>
Article
Write a recursive function to find the factorial of a number n.
def factorial(n): if n == 1 or n == 0: return 1 else: return n * factorial(n-1)
MB
Answered by
Micah B.
•
Python tutor
1793 Views
See similar Python Mentoring tutors
Related Python Mentoring answers
All answers ▸
What is the difference between a for loop and a while loop.
Manually implement a function that finds the smallest value in a list of integers and print it.
How does a for loop work in Python?
Write a function that takes a list of numbers as input, and outputs the average of the numbers. The function should catch any errors.