Discuss / Python / 学习打卡

学习打卡

Topic source

唐龙ya

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

def createCounter():

    def iterator():

        n = 1

        while True:

              yield n

              n += 1

    it = iterator()

    def counter():

        return next(it)

    return counter


  • 1

Reply