Questions: 5 831

Answers by our Experts: 5 728

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

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.

Rearrange numbers in string

sample input : I am 5years 11 months 24days and 4 min 1second

sample out : I am 1years 4 months 5days and 11 min 24second


Given an integer

N as a starting number and K as input, write a program to print a number pyramid of K rows as shown below.Input

The first line of input is an integer

N. The second line of input is an integer K.Explanation

In the example, the given starting number is

10, and the number of rows in the pyramid is 5.So, the output should be

10

11 12

13 14 15

16 17 18 19

20 21 22 23 


 Write your own unique Python program that has a runtime error. Do not copy the program from your textbook or the Internet. Provide the following.

  • The code of your program.
  • Output demonstrating the runtime error, including the error message.
  • An explanation of the error message.
  • An explanation of how to fix the error.
Victor has an array of size and he loves to play with the sun and numbers each time he play with them he pics of any two consecutive number and Odd then on adding both the number it cost him ke into some of both numbers find the minimum cost of adding all the numbers in array in python3

Write a Python program that has a runtime error.

Provide the following.

  • The code of your program.
  • Output demonstrating the runtime error, including the error message.
  • An explanation of the error message.
  • An explanation of how to fix the error.



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.



Given that n refers to a positive int use a while loop to compute the sum of the cubes of the first n counting numbers, and associate this value with total. Use no <span style="text-decoration-line: none;">variables</span> other than n, k, and total.



Describe the difference between a chained conditional and a nested conditional. Give your own example of each. 

Deeply nested conditionals can become difficult to read. Describe a strategy for avoiding nested conditionals. Give your own example of a nested conditional that can be modified to become a single conditional, and show the equivalent single conditional.


Write a python program which checks whether the given number N is between 25 and 75.


LATEST TUTORIALS
APPROVED BY CLIENTS