subject

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(str Num)
print(factorial(num))
There is no output due to a runtime error.
O-3
01

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 16:30, isaiahhuettnerowgg8d
What is one reason why indoor air pollution has become an increasing problem.
Answers: 1
image
Computers and Technology, 23.06.2019 16:30, 19thomasar
How to do this programming flowchart?
Answers: 3
image
Computers and Technology, 24.06.2019 02:30, journeyhile5
How to apply the fly in effect to objects on a slide
Answers: 1
image
Computers and Technology, 24.06.2019 05:30, MOONCHILDSUGA
If you combine two cells into one, what action are you performing? a.  adding a new row or column      b.  splitting the cells      c.  removing a new row or column      d.  merging the cells
Answers: 2
You know the right answer?
You wrote a program to find the factorial of a number. In mathematics, the factorial operation is us...

Questions in other subjects: