Discuss / Python / 返回函数

返回函数

 def createCounter():

 i=0

 def counter():

  nonlocal i

  i=i+1

  return i

 return counter


  • 1

Reply