这个错误信息的意思是:只能将字符串(不是整数)与字符串连接。
通常这个错误是因为您尝试将整数与字符串连接,但由于字符串和整数不能直接相加,因此出现了错误。要解决此错误,您需要将整数转换为字符串。例如:
age = 30
name = "John"
print("My name is " + name + " and I am " + str(age) + " years old.")
这样就可以避免 "can only concatenate str (not "int") to str" 的错误了。