Question: Question 4 # Given a number, this function will compute the factorial # For example 4! = 1 x 2 x 3 x 4 =
Question 4
# Given a number, this function will compute the factorial
# For example 4! = 1 x 2 x 3 x 4 = 24. Note that the value of 0! is 1.
def get_factorial(number):
"""
what it takes?
number to calculate its factorial
what it does?
given a number, find its factorial such as 5! = 20
Do not use a python built-in function - code it
what it returns?
factorial of a number
5! shoukld return 120
It will return integer
"""
# your code goes in here
Test case for question 4
try:
if get_factorial(5) == 120:
score['question 4'] = 'pass'
else:
score['question 4'] = 'fail'
except:
score['question 4'] = 'fail'
get_factorial(5)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
