206k views
3 votes
Complete the function to return the factorial of the parameter.

def factorial(number)
product = 1
while number > 0
product = product * number
number = number - 1
product
strNum = input("Enter a positive integer")
num = int(strNum)
print(factorial(num))

User Lit
by
5.8k points

2 Answers

7 votes

Answer:

Answer in image.

Step-by-step explanation:

Complete the function to return the factorial of the parameter. def factorial(number-example-1
User Jacob Swartwood
by
5.7k points
6 votes

def factorial(number):

product = 1

while number > 0:

product = product * number

number = number - 1

return product

strNum = input("Enter a positive integer")

num = int(strNum)

print(factorial(num))

I hope this helps!

User BigPoppa
by
5.4k points