1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
maks197457 [2]
3 years ago
8

Copy the countdown function from Section 5.8 of your textbook. def countdown(n): if n <= 0: print('Blastoff!') else: print(n)

countdown(n-1) Write a new recursive function countup that expects a negative argument and counts "up" from that number. Output from running the function should look something like this: >>> countup(-3) -3 -2 -1 Blastoff! Write a Python program that gets a number using keyboard input. (Remember to use input for Python 3 but raw_input for Python 2.) If the number is positive, the program should call countdown. If the number is negative, the program should call countup. Choose for yourself which function to call (countdown or countup) for input of zero. Provide the following. The code of your program. Output for the following input: a positive number, a negative number, and zero. An explanation of your choice for what to call for input of zero.
Computers and Technology
1 answer:
Lapatulllka [165]3 years ago
4 0

Answer:

def countdown(n):

   if n <= 0:

       print('Blastoff!')

   else:

       print(n)

       countdown(n-1)

       

def countup(n):

   if n >= 0:

       print('Blastoff!')

   else:

       print(n)

       countup(n+1)

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

if number >= 0:

   countdown(number)

elif number < 0:

   countup(number)

<u>Outputs:</u>

Enter a number: 3                                                                                                              

3                                                                                                                              

2                                                                                                                              

1                                                                                                                              

Blastoff!

Enter a number: -3                                                                                                              

-3                                                                                                                              

-2                                                                                                                              

-1                                                                                                                              

Blastoff!

Enter a number: 0

Blastoff!

For the input of zero, the countdown function is called.

Explanation:

Copy the countdown function

Create a function called countup that takes one parameter, n. The function counts up from n to 0. It will print the numbers from n to -1 and when it reaches 0, it will print "Blastoff!".

Ask the user to enter a number

Check if the number is greater than or equal to 0. If it is, call the countdown function. Otherwise, call the countup function.

You might be interested in
being able to download a chapter of a new book before buying it or trying out a software option for a month before purchasing ar
Natasha_Volkova [10]

Answer:

Experience the product

Explanation:

Being able to download a chapter of a new book before purchasing it is an example of how consumers can experience the product.

6 0
3 years ago
Bluetooth 5 allows data to be transferred between two devices at a rate of
Minchanka [31]

Answer:

2 MBPS.

Explanation:

The Bluetooth 5 raises the data transmission of information throughput from 1 Mbps to the 2 Mbps. The main advantage of Bluetooth 5 do not increasing the energy  utilization.The Bluetooth 5 increasing the volume of information that technologies can be distribute.

  • The main advantage of Bluetooth 5 decreases the time it would take to send and receive the signals,
  • The previous version of Bluetooth transmit the information from one device to the another with the 1 Mbps speed  .
7 0
3 years ago
John Sgromolo works for the 20th-largest accounting firm in the United States, but he's not an accountant. He works with hard dr
pishuonlain [190]

Answer:

Sgromolo engages in data mirroring

Explanation:

The end goal of data mirroring is to increase data protection by providing shields to a computer system thereby preventing it from data loss and other possible losses due to data failures.

The technique used in data mirroring is that, it uses realtime protection of data by taking a data and replicating the exact copy without adding to or removing from it, to another storage location.

In this technique, Sgromolo picks up these data people think are n longer usable, and duplicated by being written to two or more identical hard drives, all of which are connected to one disk controller card.

3 0
3 years ago
Read 2 more answers
U
JulijaS [17]

Answer:

sgvxvb

Explanation:

cbcbcbcb

6 0
3 years ago
You have recently been hired as the staff attorney at a growing independent film studio in Van Nuys, California. Among your duti
expeople1 [14]

Answer: dude it’s all mussed in where the question

Explanation:

4 0
3 years ago
Other questions:
  • Describe one type of technology that is useful in producing images from space.
    9·1 answer
  • ____________ is a widely accepted international best practices framework for implementing information systems security.
    12·1 answer
  • URGENT!! Ronald wants to search for an image of a sports car. Ronald doesn’t have to remember the specific name of the image to
    5·1 answer
  • Stating a document is PDF or XPS document refers to document _______​
    10·1 answer
  • Suppose a MATV/SMATV (Satellite Master Antenna Television) firm has to start it's operation in the metropolitan area of a countr
    12·1 answer
  • A hockey stick hits a puck on the ice. identify an action-reaction pair in this situation.
    10·1 answer
  • Which guideline should you follow when selecting the font for a presentation
    9·1 answer
  • Is the most important characteristic of a hard drive.​
    7·2 answers
  • You receive an email that appears to legitimately be from your Bank. The email indicates the need for verification of your infor
    15·2 answers
  • Which of the following tips for using social network will help you keep your job
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!