热线电话:13121318867

登录
2021-03-30 阅读量: 649
python报错:TypeError: an integer is required (got type str)


问:

python报错:TypeError: an integer is required (got type str)

image.png


答:

根据报错提示可知报错原因是缺少必要的参数,通过查看splitlines函数说明文档,splitlines函数用法如下:

image.png

此处出现报错是因为参数输入错误,有上述说明可知道keepends为False或者 True,默认为 False,不包含换行符,如果为 True,则保留换行符。


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

发表评论

暂无数据
推荐帖子