返回顶部

收藏

List comprehensions: map and tuple

更多
listoftuple = [('bob', 35, 'mgr'), ('mel', 40, 'dev')]

print [age for (name, age, job) in listoftuple]

print map((lambda (name, age, job): age), listoftuple)

标签:Python,List

收藏

0人收藏

支持

0

反对

0

»更多 您可能感兴趣的代码
  1. 2015-05-07 10:50:29Python list根据下标删除元素 by 甄码农
  2. 2016-05-29 20:44:54Get length of a list by jack.chen
  3. 2016-08-18 13:01:23Sort and reverse elements in list by 风云轩
  4. 2016-10-17 21:06:01List index(x) by wubai
  5. 2016-12-12 17:12:56List: delete an element by Solon.Ring
  6. 2013-06-04 13:43:27web.py中自定义jinja2模块 by 赵小全
  7. 2016-02-07 12:21:54Sorting a list. by 司马
  8. 2016-03-24 09:08:03List concatenation Demo by Solon.Ring
  9. 2016-04-23 10:04:51Adding Elements to Lists by jack.chen
  10. 2016-05-29 20:52:29Delete an element from a list by 山药
  11. 2016-08-18 13:06:34List slice assignment: delete and insert by jack.chen

发表评论