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

What phrase best defines a star system
Which genre of writing has the primary focus of imparting information or knowledge about a specific topic?
Find the length of the diagonals of the isosceles trapezoid if AC = x + 1 and DB = 2x - 3
The set of possible values of m is (5, 7, 9). What is the set of possible values of k if 2k = m + 3?
which is the value of 1/4 of 1760??
What is the radius of a circle in which a 30° arc is 2π inches long? 24 inches 12 inches 2√3 inches
what historical reasons did the northerners abolish slavery?
a bag contains 4 red marbles 6 blue marbles and 7 green marbles what is the probability of choosing a Blue Marble when one marble is drawn
70 is 5% of what number? Show work please :)
BRAINLIESTTT ASAP!!! Compare and contrast the structure and function of a compound light microscope and a dissecting microscope. Be sure to discuss when each wo