💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、豆包、星火、月之暗面及文生图、文生视频 广告
用+ 连接两个字符串 同类型的两个字符串 直接连接即可 \>>> "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()是函数 \>>>