Discuss / Python / MYH: 返回函数

MYH: 返回函数

Topic source

master_Hang

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

def createCounter():

    L=[0]

    def counter():

        L[0]=L[0]+1

        return L[0]

    return counter


  • 1

Reply