Computers and Technology

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

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 13:00, olorteguimikie
Which part of the cpu accepts data?
Answers: 1
image
Computers and Technology, 22.06.2019 20:40, broang23
Write a program that begins by reading in a series of positive integers on a single line of input and then computes and prints the product of those integers. integers are accepted and multiplied until the user enters an integer less than 1. this final number is not part of the product. then, the program prints the product. if the first entered number is negative or 0, the program must print “bad input.” and terminate immediately. next, the program determines and prints the prime factorization of the product, listing the factors in increasing order. if a prime number is not a factor of the product, then it
Answers: 2
image
Computers and Technology, 23.06.2019 16:30, mirmir62
Which of the following is not an enhancement to the standard wiki to make it more attractive for corporations? encryptionwork spacespermission toolspredictive text
Answers: 2
image
Computers and Technology, 23.06.2019 22:30, kayelynn003
How many points do i need before i can send a chat
Answers: 1
Do you know the correct answer?
You wrote a program to find the factorial of a number. In mathematics, the factorial operation is us...

Questions in other subjects:

Konu
Chemistry, 09.11.2021 23:40
Konu
History, 09.11.2021 23:40
Konu
English, 09.11.2021 23:40