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
-3
There is no output due to a runtime error.

Answers

Answer 1

Answer: well it’s not “There is no output due to a runtime error”

Explanation: Put that and I got it wrong

Answer 2

The Answer Is 1.

Edge 2020.


Related Questions

I need help please !!!!

Answers

Answer:

Second one

Explanation:

evaluation of ur problems

can someone please explain binary addition to me? i have a test tomorrow yikes

Answers

Answer:

its easy

Explanation:

there are are 5 main rules

in binary there are 2 number 0 and 1

0 + 0 = 0

0 + 1 = 1

1+0=1

1+1=0 carry 1

e . g

1 1 1

1 0 1 0 1 0

+ 1 1 0 0 1 0

-------------------------

1 1 1 1 1 0 0

*in bold are the ones that you need to carry.

in decimal there are 10 possible numbers 0- 9

when you do 1 + 9 it becomes 10, this can be done easily, however if you do 1 + 9 in a table like above, you will get 0 for the first column and you will carry 1 to the next column .

in binary is the same idea but using on 2 numbers 1 and 0

e.g

1

1

+ 9

----------

1 0

*in bold are the ones that you need to carry.

hope it helps and good luck in your exam.

2.4 Code Practice: Question 1
Write the code to input a number and print the square root. Use the absolute value function to make sure that if the user enters a negative number, the program does not crash. How do I do this in python ???

Answers

Code in Python:

num = float(input("Enter any number : "))

ab = abs(num)

sqrt = float(ab ** 0.5)

print(sqrt)

The code to input a number and print the square root is,

import math

# Input a number from the user

number = float(input("Enter a number: "))

# Use the absolute value function to handle negative numbers

abs_number = abs(number)

# Calculate the square root using the math module

sqrt_number = math.sqrt(abs_number)

# Print the square root

print(f"The square root of {number} is {sqrt_number}")

Given that,

Write the code to input a number and print the square root.

Now, A code snippet in Python that accomplishes what you described:

import math

# Input a number from the user

number = float(input("Enter a number: "))

# Use the absolute value function to handle negative numbers

abs_number = abs(number)

# Calculate the square root using the math module

sqrt_number = math.sqrt(abs_number)

# Print the square root

print(f"The square root of {number} is {sqrt_number}")

In this code, the abs() function ensures that even if the user enters a negative number, it will be converted to its positive equivalent before calculating the square root.

The math.sqrt() function is used to compute the square root, and the result is printed using the print() function.

To learn more about Function visit:

https://brainly.com/question/11624077

#SPJ6

alexa it is olewi.............................................

Answers

Answer:

jvksvksdvkbvkjsdkcn

Explanation:

Huh.........whattttt

Which act passed by the US government in 1998 criminalizes the production and distribution of technology that intends to evade anti-piracy laws?

Answers

The Computer Fraud and Abuse Act I believe. Sorry if I’m wrong and I hope that it helps :)

Answer:

Digital Millennium Copyright Act (DMCA)

Explanation:

i got it right on plato

Write a function named last_digit that returns the last digit of an integer. For example, last_digit(3572) should return 2. It should work for negative numbers as well; last_digit(-947) should return 7.

Answers

def last_digit(num):

   num = str(num)

   return int(num[-1])

print(last_digit(-947))

I hope this helps!

What am I doing wrong?

Answers

In your example, you're asking the user for a number and then you're setting total and nums equal to zero. This results in your first number being ignored by the program. I included the complete working code below:

num = int(input("Enter a number: "))

total = num

nums = 1

while (total <= 100):

   num = int(input("Enter a number: "))

   nums = nums + 1

   total = total + num

print("Sum: "+str(total))

print("Numbers Entered: "+str(nums))

I hope this helps!

My friend's newborn sister is so precious.
a. ri
c. fr
b. en
d. ie

Answers

She’s not precious ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ

Animal wisdom/ the last wolf .compare and contrast the overall feeling of each poem

Answers

List the poem please. I won’t be able to answer without it.

what is the meaning of .net in computer​

Answers

Answer:

.net is a top-level domain, also known as a TLD. Derived from the word network, it was originally developed for companies involved in networking technology. Today .net is one of the most popular domain names used by companies all over the world to launch their business online.

write a paragraph about ICT?

Answers

Answer:

ICT (information and communications technology or technologies) is an umbrella term. It includes any communication device or application, such as radio, television, cellular phones, computer and internet, satellite systems and so on. Videoconferencing and distance learning is a very important part of ICT.

it is where your cpu (processor) is installed

Answers

The motherboard (CPU SOCKET)

Answer:

OPTICAL DRIVE

Explanation:

It think

A ______ is a portable device for recording audio and video.
a. recorder
b. video
c. television
d. camcorder

Answers

Answer:

D

Explanation:

A camcorder is a portable device for recording audio and video. Thus, option D is correct.

What is video?

A video is a recording of a motion, or television program for playing through a television. A camcorder is a device or gadget that is used to record a video. audio is the sounds that we hear and mix media is a tool used to edit the video.

Digital camcorders are known to have a better resolution. The recorded video in this type of camcorder can be reproduced, unlike using an analog which losing image or audio quality can happen when making a copy. Despite the differences between digital and analog camcorders, both are portable, and are used for capturing and recording videos.

A camcorder is a self-contained portable electronic device with video and recording as its primary function. A camcorder is specially equipped with an articulating screen mounted on the left side, a belt to facilitate holding on the right side, hot-swappable battery facing towards the user, hot-swappable recording media, and an internally contained quiet optical zoom lens.

Therefore, A camcorder is a portable device for recording audio and video. Thus, option D is correct.

Learn more about recording audio on:

https://brainly.com/question/27861365

#SPJ5

Identify 5 way computer are used in weather forecasting an traffic control​

Answers

Answer:

Computers are used for interpolating data, and analyzing very complicated data.

Explanation:

In forecasting we need to look at a lot of weather variables (temperature, dew point, pressure and wind speed to name a few). We only collect this data from weather observation sites which can be tens to hundreds of kilometers apart. In order to determine these values at locations between the observation sites we interpolate.

When you are forecasting you need look at a lot of data and determine what is going on to determine what is going to happen next. If humans did all the interpolating themselves for all the data they would never be able to issue the forecast in the time that is expected. Furthermore, now that we have very complicated values to analyze (vorticity for example) there is no way that a human can calculate the effect of all the various factors in play. A computer has to do it.

Computers are also required for using weather radar, and yes to a lesser extent satellite data.

You want to add a picture of a potential new office layout to the title page of a proposal. How can you adjust the size of the image without changing its proportions?

Answers

Answer:

You can adjust the size of an image without changing its proportion by holding down the shift key while adjusting one of the edges.

How many categories should Jane use to track multiple levels of information learned through a student survey on teachers at her school? a. One category per teacher c. As many categories as she needs to understand the results b. Only one teacher per category d. None of these Please select the best answer from the choices provided A B C D

Answers

Answer:

c. As many categories as she needs to understand the results

Explanation:

In order to do this, she should track as many categories as she needs to understand the results. This is because Jane might need to understand various aspects of different teacher's performance during school hours. To do so she would need many different categories that apply to all of the teachers. That way when she gathers the results she can see which teachers perform best in a specific category when compared to the others, thus giving Jane a better understanding of each teacher's overall performance.

Answer:

i think its c because, In order to do this, she should track as many categories as she needs to understand the results. This is because Jane might need to understand various aspects of different teacher's performance during school hours. To do so she would need many different categories that apply to all of the teachers. That way when she gathers the results she can see which teachers perform best in a specific category when compared to the others, thus giving Jane a better understanding of each teacher's overall performance.

Explanation:

write important of ICT in personal life?

Answers

Answer:

ICT is a great impact for are daily lives. It can improve the quality of a human life. The reason why it can improve that, it’s because it can be used as a learning and education media, the mass communication media in promoting and campaigning practical and important issues, such as the health and social area.

Explanation:

Sam needs to create a spreadsheet for his coworkers. They will need to follow across a long row of data. Sam would like to make his spreadsheet easy to read. Sam should _____.

Answers

Complete Question:

Sam needs to create a spreadsheet for his coworkers. They will need to follow across a long row of data. Sam would like to make his spreadsheet easy to read. Sam should _____.

Group of answer choices

A. make some formatting changes such as adding a fill color to every other row.

B. change the text color to light green and change the fill color to red.

C. leave the spreadsheet without any format changes.

D. highlight the cells.  

Answer:

A. make some formatting changes such as adding a fill color to every other row.

Explanation:

A spreadsheet can be defined as a file or document which comprises of cells in a tabulated format (rows and columns) typically used for formatting, arranging, analyzing, storing, calculating and sorting data on computer systems.

Some examples of spreadsheet software applications are Microsoft Excel, Lotus symphony, iWork numbers, Google sheets etc.

In this scenario, Sam needs to create a spreadsheet for his coworkers. They will need to follow across a long row of data with informations such as name, age, gender, education, experience, address, date of birth, nationality, relationship status etc. Also, Sam would like to make his spreadsheet easy to read.

Hence, Sam should make some formatting changes such as adding a fill color to every other row by selecting the preferred row and choosing a specific color that he wants such as red, white, green, blue, yellow etc.

Basically, formatting a spreadsheet with different colors makes it easy to read and enhances quick location of specific information in the spreadsheet by the end users.

HELP PLEASE SOMEONE PLEASE HELP ME!!!!!

Answers

I feel it is C, but I am not sure if it is correct, I can only apologize if it is wrong.

please help me I want the answer for the 3rd question ​

Answers

Use the multiples thats are included in the flowchart and divide them by half a divisible

How do you halt an infinite loop?
by pressing the Control key and the

key

Answers

write code creating an infinite loop, with my new Excel, the Ctrl + Break no longer works. Neither does the Esc key, etc.

I've looked all over the web and it appears that Microsoft has a bug and doesn't care to fix it.

Is there a way to re-introduce the Ctrl + Break function to VBA so if this happens in the future I don't lose work / force close?

Answer:c

Explanation:ctrl and c stops a infinite loop

What is the purpose of i in the code?

for (var i = 0; i < fruitList.length; i++ ) {
console.log (fruitList [ i ] );
}

Answers

Answer:

i is a variable used to store information in this case the number 0. The i is then added to repeatedly to create a list.

Identify the type of data for each value below.
12.023
"Hello World
52

Answers

12.023 is float

"Hello World" is string

52 is int

Your teacher is nice. She/He has given it in the order.

The type of data for 12.023 is a float, "Hello World is a string, and 52 is a int.

What are the type of data?

The  type of data in computer science can be given as the data values that helps in the analysis of the type of operation that is to be performed. The data types in python are given as classes.

The type of data type is:

The point numbers are given as floating. Hence, 12.023 is a float.

The text form is given as string or str data type. Hence, "Hello World is a string.

The whole numbers positive or negative are given as integers or int. Hence, 52 is a int.

Learn more about data type, here:

https://brainly.com/question/22574321

#SPJ2

What does a network backbone do?
allows data to be delivered more quickly and efficiently
makes data transfer from the cloud more secure
connects different network functions, such as printers and modems
configures random local networks in major cities that make up the Internet

Answers

Answer:

configures random local networks in major cities that make up the internet.

Answer:

D

Explanation:

How many times is the coin tossed?

var heads = 0;
var tails = 0;
var rolls = 100;
for(var i = 0; i < rolls; i++){
if(randomNumber(0,1) == 0){
heads++
} else {
tails++
}
}

Answers

Answer:

100 times.

Explanation:

The code will loop until i is equal to or greater than roles. I starts at zero and increases by one after each toss.

The answer is what the other guy said

[Exceptions, Function calling another function] Write a function ticker() that first runs (calls) read_ticker() and then stores the returned dictionary. It then runs an interactive loop with the user in which the user is prompted for a company name. If the company name (key) is in the dictionary, then its ticker form and the IPO year is printed. Otherwise a warning is printed that the company name is not in the list. If the user just hits return without entering a name, the loop stops.




this is the function that needs to be called:
def read_ticker():
d = {'1347 Capital Corp.': ('TFSCW', '2014'), '1347 Property Insurance Holdings, Inc.': ('PIH', '2014'), '1-800 FLOWERS.COM, Inc.': ('FLWS', '1999')}
return d

Answers

def read_ticker():

   d = {'1347 Capital Corp.': ('TFSCW', '2014'), '1347 Property Insurance Holdings, Inc.': ('PIH', '2014'),

        '1-800 FLOWERS.COM, Inc.': ('FLWS', '1999')}

   return d

def ticker():

   di = read_ticker()

   while True:

       try:

           name = input("Enter the name of a company: ")

           if name == "":

               return

           print(di[name])

       except KeyError:

           print("Name not found! Please enter a valid name!")

ticker()

I hope this helps!

What is the main citation style for English and humanities classes? Modern Language Association style (MLA) American Psychological Association style (APA) .edu style (EDU) .gov style (GOV)

Answers

Answer:

MLA

Explanation:

Answer:

A) Modern Language Association style (MLA) Is your answer!

Explanation:

If you think about it the other answers either don't fit or don't make sense! :)

Hope this helps! :)

Discuss one simple example of hybrid computer.​

Answers

Answer:

thermometer , petrol pump

Identify way computer are used in television production​

Answers

Answer:

image editing, text om screen, weather graphics, animation, sattelites ... a lot more possibilites are endless just limited

Businesses with very large sets of data that need easy access use sets of cartridges with robot arms to pull out the right one on command.This is known as______.

a.
removable hard drives
b.
smart cards
c.
mass storage
d.
USB drives

Answers

Answer:

C. Mass Storage

if incorrect then:

A. Removable Hard Drives

Other Questions
how do i simplify 4^(n-2)+4^(n-1)+...+4^0 which is better impostor or crew mate? what is the range of f? Which statement best describes political causes of the Yuan dynastys decline? Yuan princes argued over who would be emperor. Yuan policies made the empire open to invading armies. Yuan rulers overtaxed the Chinese, spent too much, and lost foreign battles. Yuan policies hurt traders and artisans, which weakened trade and the economy. I WILL GIVE BRAINLIEST. HURRY review the micrographs of cells shown in figure 8-3. what information about cells do these micrographs suggest, which might not be accurate? Compared to a human, what is similar about how this organism gets molecules from food and air? The measurement system used by most scientists and engineers known as the international System ofUnits is represented by the two letters. QUICK!!!!! Analyze the conditional statement below and complete the instructions that follow.If m is the midpoint of AB, then M divides AB into two congruent segments.Identify the inverse of the converse of the conditional statement.O If M is not the midpoint of AB, then M does not divide AB into two congruent segments.If M is the midpoint of AB, then M divides AB into two congruent segments.If M divides AB into two congruent segments, then M is the midpoint of AB.Olf M does not divide AB into two congruent segments, then M is not the midpoint of AB. What important item was forgotten during the inaugural process with George Washington? ANSWER ASAP PLEASE I WILL GIVE THE BRAINLIEST THINGY!!Sparky ate 2 1/2 bones in the morning and 1 2/3 bones in the afternoon. How many bones did Sparky eat all together? please help me with this work Alice rode her bicycle the same number of miles every day for 17 days. Sherode a total of 68 miles during these 17 days. At this rate, how many miles didAlice ride her bicycle in 1 day? i need help on this question A teacher is giving a lecture on the changes in world population over the last decade. Which is the best visual aid forthe teacher to use?O a bar graphO a map a line graphO a diagram please solve this i will give you brainliest What was Po'Pay's Rebellion? Please help. I really need help An angle turns through 75/360 of a circle. what is the measure of the angle? Can someone help me? Giving 23 Points. What is the wavelength of light falling on double slits separated by 2.00 m if the third-order maximum is at an angle of 60.0?