python里的map函数用法的代码

内容分享1个月前发布 Le7en_
0 0 0

在代码过程中中,把代码过程中常常用的一些代码段珍藏起来,下面代码内容是关于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)

                               

                       

               

               

           

           

               

© 版权声明

相关文章

暂无评论

您必须登录才能参与评论!
立即登录
none
暂无评论...