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

In industrialized democracies, most people born are digital natives?
So I like to dance who does!
use vieta's formulas to find the sum and the product of the roots of the equation: x^2-210x=0
what are characteristics of a traditional economy FOUR AWNSERS
a bookcase is 2.3 metres tall and the height of each self is 34 cm how many shelf are there?​
1000:400:300 simplfied​
Please help ASAP will mark brainliest How do we find the amount of uncertainty we should expect in our measurement of the period? Come up with and explain a met
How many faces does the polyhedron have? _ faces How many vertices does the polyhedron have? _vertices How many edges does the polyhedron have? _edges
The temperature is -3 degrees celcius at sunrise. By noon, the temperature changes by 5 degrees. What is the possible temperature at noon?
Which mass of gas would occupy a volume of 3dm3 at 25°C and 1 atmosphere pressure? [1 mol of gas occuples 24 dm at 25°C ana A 3.29 O2 gas B 5.6g N, gas C 8.09 S