Computers and Technology
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

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 21:30, elsauceomotho
Im doing this last minute and literally none of my neighbors or people that my dad works with use excel so if anyone could me make up an example
Answers: 1
image
Computers and Technology, 22.06.2019 23:30, keviongardner
The next button in the review section shows the next available comment. next slide with no comment. previous comment. edited comment.
Answers: 1
image
Computers and Technology, 23.06.2019 15:00, lopez7512
What is the total resistance in a circuit that contains three 60 ohm resistors connected in a series? a. 20 ohms b. 120 ohms c. 60 ohms d. 180 ohms
Answers: 2
image
Computers and Technology, 24.06.2019 10:00, alexapacheco012
What did i do wrong with this const discord = require('discord. js'); var bot = new discord. client(); const token = 'ntm3mjcxmtu1mjg3ote2ntq2.dyogew. dpfiwfpuifzuzvifop-csuxasnm' const prefix = "! " bot. registry. registergroup('simple', 'simple'); bot. registry. registerdefaults(); bot. registry. + '/commands'); bot. on('message', message => { if(message. content == 'hi! ') { message. channel. send ('@everyone sup, how is @everyone day going'); } if(message. content == 'h3lp') { message. channel. send ('dose not have any commands yet'); } bot. on('ready', function() { console. log("ready") }); bot. login(token);
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: