56.9k views
5 votes
You wrote a program to find the factorial of a number. In mathematics, the factorial operation is used for positive integers and zero. What does the function return if the user enters a negative three? 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))

-6
1
-3
There is no output due to a runtime error.

User Nirva
by
5.6k points

2 Answers

5 votes

Answer: well it’s not “There is no output due to a runtime error”

Explanation: Put that and I got it wrong

User Robert Paulson
by
5.7k points
2 votes

The Answer Is 1.

Edge 2020.

User David Pursehouse
by
5.9k points