以下示例显示了我在尝试在函数调用中使用字符串函数以进行映射时遇到的错误。我需要帮助了解为什么会发生这种情况。谢谢。
>>> s=["this is a string","python python python","split split split"]
>>> map(split,s)
Traceback (most recent call last):
File "<pyshell#16>", line 1, in <module>
map(split,s)
NameError: name 'split' is not defined
虽然split()
是一个内置函数,但它仍然会抛出这个错误?