为了账号安全,请及时绑定邮箱和手机立即绑定

Python字符串和整数连接

Python字符串和整数连接

慕的地6264312 2019-07-30 14:24:38
Python字符串和整数连接我想在for循环中使用附加到它的整数创建字符串。像这样:for i in range(1,11):   string="string"+i但它返回一个错误:TypeError: unsupported operand type(s) for +: 'int' and 'str'连接String和Integer的最佳方法是什么?
查看完整描述

3 回答

  • 3 回答
  • 0 关注
  • 1180 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信