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

2 Points If F(x) = x - 2, which of the following is the inverse of F(x)?
The probability that house sales will increase in the next 6 months is estimated to be 0.25. The probability that the interest rates on housing loans will go up
Which agents of socialization will have the strongest impact on an individual?
Please help,TYSM IF YOU HELP
Two investment centers at Marshman Corporation have the following current-year income and asset data: Investment Center A Investment Center B Investment center
(20 pts!) if the base of the roof has length 40 feet and x=30, which of the following gives the height of the roof?
A researcher using a small sample of an easily distinguishable group of subjects wishes to use extensive quotes in the research report. This researcher risks:
Por eso mi amigo Paulo__ un taxi que nos recogió en el hotel. a habíamos visto b. habían visto C. había visto Please select the best answer from the choices pro
I need help which ones are the correct answers
HELP PLEASE!! The Powhatan Indians helped to revive the Jamestown colony by exchanging food for copper and __________ implements.