ENglish00927 ENglish00927
  • 09-07-2020
  • Computers and Technology
contestada

Write a program that input a number and display its precessor and successor number using function.

Respuesta :

samgirshovich
samgirshovich samgirshovich
  • 14-07-2020

Answer:

def ask():

x = int(input("Pick a number: "))

p = x - 1

s = x + 1

print("The predecessor is {} and the successor is {}.".format(p, s))

ask()

Explanation:

"def ask():" and everything indented defines the function and "ask" calls the function.

Answer Link

Otras preguntas

Each side of a square is increased 7 inches. when this happens, the area is multiplied by 4. how many inches in the side of the original square?
Determine if 12yd 14yd and 16yd make a right triangle?
Which statement best describes the US government 's role with the blanking industry at the beginning of the depression?
how did people from america, europe, and africa come together? and what sort of nation did they build?
What is the greatest common factor of 6x^2 and 8x?
Calculate the caloric content of skim milk and whole milk. per serving, skim milk contains 12 g carbohydrates, 8 g protein, and no fat; whole milk contains 12 g
2 in scientific notation
A rock is thrown upward with a velocity of 21 meters per second from the top of a 43 meter high cliff, and it misses the cliff on the way back down. When will t
How many quarts are in 14 liters
which number line shows the solution to 3 + (-3)?