TypeError: can only concatenate str (not "int") to str 长乐无暇 2026-02-21 0 阅读1分钟 问题 TypeError: can only concatenate str (not "int") to str 类型错误:只能将 str(而非“int”)与 str 连接。 问题分析 连接字符串时没有将数值类型数据转换成字符串类型 解决办法 将提示错误的地方的数值型数据转换成字符串类型数据