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

Name at least three ways in which the Declaration of Rights and Toleration Act limited the power of British Kings.
Given three consecutive odd integers whose sum is 369, find the smallest of the three integers.
Savannah used 2 quarts of paint on a summer project. She still had 5. quarts of paint left when she was finished. How much paint did Savannah have at first? la
What is the square root of 81? A. 11 B. 9 C. 18 D.8
Please answer,ASAP please and thank you OWO
more points and more brainliest! Just answer this question (correct answer will get brainly)
Choose a number line to model the following situation: After a gain of 25 yards, the football team lost 25 yards on the next play.
which of the following is an acid? HF KOH LIF NH3
The total cost of a watch and a radio is Rs 500. If the watch is cheaper than the Equations radio by Rs 150, find their cost.​
double the sum of a number w and 3
good job