摘要:
def haha(li=None): a=li or []dict(a=1,b=2,c=3) 阅读全文
posted @ 2010-03-09 09:17
lexus
阅读(129)
评论(0)
推荐(0)
|
摘要:
def haha(li=None): a=li or []dict(a=1,b=2,c=3) 阅读全文
posted @ 2010-03-09 09:17
lexus
阅读(129)
评论(0)
推荐(0)
摘要:
如下一个场景def a(): count=0 def _a(): global count count+=1 _a() _a() return _count如上的一个函数,在实际执行时是报错的,因为没有global的变量 count,我想问的是像这样一个场景,用怎么样的实现来做好一些呢?是否有在函数内部保留状态的机制,yield是有,不过这里好像是用不到,请达人请点哈。我自己试验了下是采用这样的方... 阅读全文
posted @ 2010-03-09 09:16
lexus
阅读(212)
评论(0)
推荐(0)
|