摘要:
简单的例子>>> [x*x for x in range(10)][0, 1, 4, 9, 16, 25, 36, 49, 64, 81]>>> [x*x for x in range(10) if x % 3 == 0][0, 9, 36, 81]>>> [(x,y) for x in range(3) for y in range(3)][(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2), (2, 0), (2, 1), (2, 2)]复杂些的例子——找出首字母相同的男孩和女孩>> 阅读全文
posted @ 2012-08-06 21:37 immiki 阅读(217) 评论(0) 推荐(0) 编辑