Discuss / Python / 作业

作业

Topic source

Super-String

#1 Created at ... [Delete] [Delete and Lock User]
def createCounter():
    # 定义一个变量 count,用于记录计数器的值
    count = 0
    def counter():
        nonlocal count
        count += 1
        return count
    return counter

  • 1

Reply