Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'list' object is not callable
剛開始學習python的時候,可能會由於命名的不注意,導致也方法一直用不了,原因是在聲明變量對的時候和python內置方法沖突了,導致方法被重新定義了,這樣一來,方法自然也就不存在了
解決辦法:先復制個其他的list
c = list.copy()
然后清空list列表名的列表
list.clear()
再次使用list( ),成功聲明並賦值
l1 = list(range(10))