使用python map和其他功能工具

使用python map和其他功能工具,第1张

使用python map和其他功能工具

最简单的方法是不

bars
通过不同的功能,而直接从
maptest
以下位置访问它:

foos = [1.0,2.0,3.0,4.0,5.0]bars = [1,2,3]def maptest(foo):    print foo, barsmap(maptest, foos)

使用原始

maptest
函数,您还可以在
map
以下代码中使用lambda函数:

map((lambda foo: maptest(foo, bars)), foos)


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5644440.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-16
下一篇 2022-12-16

发表评论

登录后才能评论

评论列表(0条)

保存