在代码过程中中,把代码过程中常常用的一些代码段珍藏起来,下面代码内容是关于python里的map函数用法的代码,应该是对大伙有所用途。
#map function
#basic syntax
def mul2(x):
testList = [1,2,3,4]
print map(mul2,testList)
#map function that has two arguments
def mul(x,y):
print map(mul,[1,2,3,4],testList)
© 版权声明
文章版权归作者所有,未经允许请勿转载。
相关文章
暂无评论...


