Discuss / Python / ZUOYE

ZUOYE

Topic source

Lin-林堔

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

def createCounter():

    c = [0]

    def counter():

        nonlocal c

        c[0] += 1

        return c[0]

    return counter


  • 1

Reply