QUESTION
Write a program that reads an integer number and prints its previous and next numbers. See the examples below for the exact format your answers should take. There shouldn't be a space before the period.
Remember that you can convert the numbers to strings using the function
ANSWER
number = int(input())
next_number = number + 1
previous_number = number - 1
print( 'The next number for the number '+str(number)+' is '+str(next_number)+'.')
print('The previous number for the number '+str(number)+' is '+str(previous_number)+'.')
SAMPLE OUTPUT
Input :
179
Output :
The next number for the number 179 is 180.
The previous number for the number 179 is 178.
Write a program that reads an integer number and prints its previous and next numbers. See the examples below for the exact format your answers should take. There shouldn't be a space before the period.
Remember that you can convert the numbers to strings using the function
str
. ANSWER
number = int(input())
next_number = number + 1
previous_number = number - 1
print( 'The next number for the number '+str(number)+' is '+str(next_number)+'.')
print('The previous number for the number '+str(number)+' is '+str(previous_number)+'.')
SAMPLE OUTPUT
Input :
179
Output :
The next number for the number 179 is 180.
The previous number for the number 179 is 178.