Объясните , почему на python код
n=int(
print("the next number for the number" + n + "is " + str(n+1) + ".")
print("the previous number for the number " + n + "is " + str(n-1) + ".")
не работает, а
n= int(
print ('the next number for the number', n,'is',str(n+1)+'.')
print ('the previous number for the number',n,'is',str(n-1)+'.')
работает
(пишет traceback (most recent call last):
file "1.py", line 2, in
print("the next number for the number" + n + "is " + str(n+1) + ".")
typeerror: can only concatenate str (not "int") to str)