python map函数使用中出现的问题

问题描述:

img

list(map(bark, ['hello', 'hi', 'hey']))
Traceback (most recent call last):
  File "<pyshell#30>", line 1, in <module>
    list(map(bark, ['hello', 'hi', 'hey']))
TypeError: 'map' object is not callable

如图所示,map函数无法运行,出现异常

应该是你用map作为变量名储存了数据,导致map函数被覆盖掉了