Discuss / Python / 打卡

打卡

Topic source

雅乐landa

#1 Created at ... [Delete] [Delete and Lock User]

def createCounter():

        def iter():

            n=1

            while True:

                yield n

                n=n+1

        it=iter()

        def counter():

            return next(it)

        return counter


  • 1

Reply