热线电话:13121318867

登录
2021-03-18 阅读量: 2622
TypeError: 'str' object cannot be interpreted as an integer

python3 ,pycharm中运行


page = input('please enter the page: ')

for i in range(0, page):


报错

TypeError: ‘str’ object cannot be interpreted as an integer


input读取的类型是str(字符串),需要转换成int类型


page = int(input('please enter the page: '))

for i in range(0, page):


109.0909
0
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子