subject

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.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:00
Which of the following statements tests if students have a grade of 70 or above, as well as fewer than five absences? a: if(grade > = 70 and daysabsent < = 5): b: if(grade > = 70 or daysabsent < = 5): c: if(grade > 70 and daysabsent < = 5): d: if(grade > 70 or daysabsent < = 5): i took the test the answer is a
Answers: 1
question
Computers and Technology, 23.06.2019 05:00
Jason works as an accountant in a department store. he needs to keep a daily record of all the invoices issued by the store. which file naming convention would him the most?
Answers: 2
question
Computers and Technology, 23.06.2019 07:50
Most shops require the technician to enter a starting and ending time on the repair order to track the actual time the vehicle was in the shop and closed out by the office. this time is referred to as _ time ? a. comeback b. ro c. cycle d. lead
Answers: 1
question
Computers and Technology, 24.06.2019 02:10
Aspeed limit sign that says "night" indicates the legal speed between sunset and sunrise.
Answers: 2
You know the right answer?
Copy the countdown function from Section 5.8 of your textbook. def countdown(n): if n <= 0: print...
Questions
question
Computers and Technology, 11.10.2019 23:00
question
Mathematics, 11.10.2019 23:00
question
Social Studies, 11.10.2019 23:00
question
Mathematics, 11.10.2019 23:00
Questions on the website: 13722360