多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
用+ 连接两个字符串 同类型的两个字符串 直接连接即可 \>>> "py"+"thon" 'python' 不同类型的,使用强制转换将他们转换成统一类型的 \>>> a=123 \>>> b="hello" \>>> print(a+b) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: unsupported operand type(s) for +: 'int' and 'str' \>>> print(str(a)+b) #str() 是一种对象类型 123hello \>>> print(repr(a)+b) 123hello \#repr()是函数 \>>>