Discuss / Python / 学到现在还是似懂非懂

学到现在还是似懂非懂

Topic source

友仔

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

def createCounter():

    x = 0

    def counter():

        nonlocal x

        x = x+1

        return x

    return counter


  • 1

Reply