# 匿名函数
# 函数名 = lambda 参数1,(参数2,....) : 返回值 [注意:匿名函数不允许换行]
# 匿名函数返回值和正常函数一样可以是任意数据类型
# def add(x,y):
# return x+y
# add = lambda x, y: x+y
# print(add(3,6)) # dic = {'k1':10,'k2':100,'k3':30}
# def func(num):
# return dic[num] # 返回值是dic里面的value值
# print(max(dic,key=lambda k:dic[k])) # ret = filter(lambda y:y>6, [6,5,4,-9,88,67])
# for i in ret:
# print(i) # ret = map(lambda x: x ** 2 ,[-1,2,3,-4])
# for i in ret:
# print(i) # min max map filter sorted 都可以和 key= 合作 # 练习题:使用匿名函数把(('a'),('b')),(('c'),('d'))变成列表[{'a':'c'},{'b':'d'}]
# max min sorted filter map
# 匿名函数 === 内置函数
# zip res1 = zip((('a'),('b')),(('c'),('d')))
res2 = map(lambda tup:{tup[0]:tup[1]},res1)
print(list(res2))

最新文章

  1. 解密jQuery事件核心 - 绑定设计(一)
  2. 夺命雷公狗----Git---7---GitHub当仓库本地使用(完)
  3. SQL(触发器)
  4. jquery fadeOut 异步
  5. spring mvc 中文乱码 post与get的方法解决
  6. iOS开发—字典转模型,KVC设计模式
  7. ubuntu系统软件
  8. Android下的Linux指令集
  9. cf D. Levko and Array
  10. LINUX小技巧,如何在指定目录下搜索到含特定关键字的文件。
  11. Laravel默认使用utf8_unicode_ci 即使数据库是utf8_general_ci
  12. Graphical Analysis of German Parliament Voting Pattern
  13. julia 安装
  14. ERP结账不自动清台的解决办法
  15. PHP7语法知识(三):时间与日期、表单、类与对象、正则表达式、错误异常处理、图像处理
  16. MySQL登录报错ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
  17. github的pull request是指什么意思
  18. Grape教程-params
  19. Solr 后台查询实例 (工作备查)
  20. 【转】腾讯移动品质中心TMQ [腾讯 TMQ] 测试管理平台大比拼

热门文章

  1. ios---photo实现保存图片到自定义相册
  2. iOS 利用UICollectionView做一个无限循环广告栏
  3. python笔记13
  4. 用java编写代码实现关机
  5. java加解密算法--DES
  6. 用ExpressionTree实现JSON解析器
  7. Codeforces 1248C Ivan the Fool and the Probability Theory(推公式)
  8. Python:自动化上传OSS
  9. Go语言实现:【剑指offer】复杂链表的复制
  10. 微信支付v3版本NET 图片上传API