a = 0 def CounterA(): def f(): global a a = a + 1 return a return f s = [0] def CounterB(): def f(): s[0] = s[0] + 1 return s[0] return f
计数器(每次调用函数增1)
猜你喜欢
转载自blog.csdn.net/sxf_123456/article/details/82050643
今日推荐
周排行