def createCounter(): def counter(): n=0 while True: n=n+1 yield n x=counter() def fext(): return next(x) return fext
def createCounter():
i=0
def counter():
nonlocal i
i=i+1
return i
return counter
Sign in to make a reply
喜欢游戏的发