I am new to Python, will someone be able to figure out what this means
HarryPall (0)

Traceback (most recent call last):
File "python", line 4, in <module>
TypeError: can only concatenate str (not "int") to str

this error showed up when i wrote:
NUMBER = int(input())
a = (NUMBER - 1)
b = (NUMBER + 1)
print ("The next number for the number" + (NUMBER) + "is" + (b))
print ("The previous number for the number" + (NUMBER) + "is" + (a))

You are viewing a single comment. View All
Answered by RyanRana (168) [earned 5 cycles]
View Answer
mwilki7 (194)

change

print ("The next number for the number" + (NUMBER) + "is" + (b))
print ("The previous number for the number" + (NUMBER) + "is" + (a))

to

print ("The next number for the number" + str(NUMBER) + "is" + (b))
print ("The previous number for the number" + str(NUMBER) + "is" + (a))