clear
>>> heros=["钢铁侠","绿巨人"]>>> heros
['钢铁侠', '绿巨人']
>>> heros.clear()
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
heros.clear()
AttributeError: 'list' object has no attribute 'clear'
>>>
为什么按照视频会错误,菜鸟求助! 应该是你的Python版本太旧了,clear()方法都没有{:10_260:} 建议把Python 2升级为 Python 3
页:
[1]