python中print(),不能同时输出文本和整型数字。
1.错误示范
x = 1
print("数字哦"+ x)
输出:TypeError: can only concatenate str (not “int”) to str
2.正确示范
x = "字符串"
print("数字哦"+ x)
输出:数字哦字符串
python中print(),不能同时输出文本和整型数字。
1.错误示范
x = 1
print("数字哦"+ x)
输出:TypeError: can only concatenate str (not “int”) to str
2.正确示范
x = "字符串"
print("数字哦"+ x)
输出:数字哦字符串