Question: In Python def factorial(n): ''' (10 points) Function that takes an integer and returns the value of n factorial (n!). - If n is negative
In Python
def factorial(n): ''' (10 points) Function that takes an integer and returns the value of n factorial (n!). - If n is negative or not an int type, return the sentinal value of -1 - Your solution should use a for loop and not use functions from python's math module. - Hint: note that 0! = 1. You may have to adjust your range in your for loop to account for this. ''' return "stub"
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
