Computers and Technology, 10.11.2020 17:20 chloeboo
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
Answers: 1
Computers and Technology, 23.06.2019 13:00
Which of the following statements is false? a. a class can directly inherit from class object. b. if the class you're inheriting from declares instance variables as private, the inherited class can access those instance variables directly. c. a class's instance variables are normally declared private to enforce good software engineering. d. it's often much more efficient to create a class by inheriting from a similar class than to create the class by writing every line of code the new class requires.
Answers: 3
Computers and Technology, 23.06.2019 22:30
How many points do i need before i can send a chat
Answers: 1
Computers and Technology, 24.06.2019 08:30
Why might you choose to create a functional resume
Answers: 1
You wrote a program to find the factorial of a number. In mathematics, the factorial operation is us...
Mathematics, 03.06.2021 01:10
Mathematics, 03.06.2021 01:10
Spanish, 03.06.2021 01:10
Mathematics, 03.06.2021 01:10
Business, 03.06.2021 01:10
Mathematics, 03.06.2021 01:10
Mathematics, 03.06.2021 01:10
English, 03.06.2021 01:10