def printPreviousAndNext():
take = input()
print("The next number for the number" + take + "is" + int(take+1))
print("The previous number for the number" + take + "is" + int(take-1))
printPreviousAndNext()
As you can see I want to give an input and want to print its previous and next numbers for example:
my input: 200
What I want the result to be is:
The next number for the number 200 is 201
The previous number for the number 200 is 199
But I am getting an error which is as follows:
Traceback (most recent call last):
File "python", line 5, in <module>
File "python", line 3, in printPreviousAndNext
TypeError: can only concatenate str (not "int") to str
Where is my mistake?