python中的坑:‘range‘ object has no attribute ‘remove‘
python中的坑:‘range’ object has no attribute ‘remove’前言看别人代码的时候,遇到b=range(2)b.remove(1)由于自己比较少接触到用remove的场景,所以不太明白用法,所以就在IDLE中测试一下,看一下发生了什么,结果抛出AttributeError:'range' object has no attribute 'remove'的错误,一脸懵逼,找资料好像都是直接解释说range得到的b不可以进行remove,但自己运行代码发
原创
2020-09-11 15:20:14 ·
6837 阅读 ·
7 评论