TypeError: 'zip' object is not callable

>>> list=zip('1234','abc')
>>> list(list)
Traceback (most recent call last):
  File "", line 1, in
    list(list)
TypeError: 'zip' object is not callable
>>> l=zip('ab','123')
>>> l

>>> list(l)
Traceback (most recent call last):
  File "", line 1, in
    list(l)
TypeError: 'zip' object is not callable


这是因为自定义了list,所以出错,del(list)后,就可以了。

>>> del(list)
>>> list(l)
[('a', '1'), ('b', '2')]

你可能感兴趣的:(python)