常用函数考察:
  dict(zip(('a','b','c','d','e'),(1,2,3,4,5)))
  range(10)   
  sorted([i for i in range(10)])
  { i:i*i for i in range(10) if i%/2==1 }
  [ [i,i*i] for i in range(10)]
函数参数考察:
def f(x,l=[]):
   for i in range(x):
      l.append(i*i)
   print l
f(2)
f(3,[1,2,34])
f(3)
f(4)
 
#闭包用法考察:
def  lamb():
   return [lambda x: x*i for i in range(4)]
#          lambda x: x*i 作为列表生成式的结果, 最终return了4个 lambda函数组成的列表。
print [m(2) for m in lamb()]
点击查看更多内容
					为 TA 点赞
										
				 评论
				共同学习,写下你的评论
评论加载中...
作者其他优质文章
					正在加载中
				
			感谢您的支持,我会继续努力的~
		扫码打赏,你说多少就多少
		赞赏金额会直接到老师账户
		支付方式
		打开微信扫一扫,即可进行扫码打赏哦
	 
                 
             
			 
					 
					