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
There is no output due to a runtime error.
-3
2 answers:
Answer: 1
Explanation:
got it on Edge.
Answer:
The correct answer is 1
Explanation:
Correct on edge 2020
You might be interested in
As far as humans are concerned. What's written in the programming language needs to interpreted or compiled into something that the machine can actually deal with.
To copy the formatting of selected text to another place in the document use the paintbrush AKA. Format painter
The answer is one ☝️ question for the poll of a vote
Create a bulleted list of four descriptive terms describing possible values a person may have. * always be true to yourself * honesty is the best policy * making mistakes leads you to solutions * it's ok to be wrong
Answer:
i wish i could help you
Explanation:
i wish i could help you