如何实现Python中的map函数
>>> def myMap(f,listA):
>>> if listA == []:
>>> return []
>>> return [f(listA[0])] + myMap(f,listA[1:])
>>>
>>> def add(x):
>>> return x+5
>>>
>>> myMap(add,[1,2,3])
>>> [6,7,8]
>>> def myMap(f,listA):
>>> if listA == []:
>>> return []
>>> return [f(listA[0])] + myMap(f,listA[1:])
>>>
>>> def add(x):
>>> return x+5
>>>
>>> myMap(add,[1,2,3])
>>> [6,7,8]