Discuss / Python / 数值类型不能修改有点麻烦

数值类型不能修改有点麻烦

Topic source

大能猫929

#1 Created at ... [Delete] [Delete and Lock User]
def createCounter():
  n=[0]
  def counter():    n[0] += 1
    return n[0]
  return counter

  • 1

Reply