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

Related Python Mentoring answers

All answers ▸

Generate an array of integers from 0 to 99 and split it into two smaller arrays. Each smaller array will contain half of the original.


Write a program that computes the sum of all numbers up to a input number n


Write a simple Python program that asks a user to input their age and name and then return the text: "Hi my name is *NAME*, and I am *AGE* years old."


Write a program that can convert between celcius and farenheit temperature scales