【发布时间】:2016-02-26 22:37:11
【问题描述】:
我正在制作一个 python 脚本,它只是为了好玩而回话,我希望它每次都随机选择一个话题来谈论这里是我的代码的 sn-p
def randsub():
rand = random.randrange(1,3)
rand.toString()
randsub = "sub" + rand
randsub()
但它一直给我这个错误 TypeError: 无法将 'int' 对象隐式转换为 str
【问题讨论】:
标签: python string python-3.x int