当前位置: 代码迷 >> 综合 >> python-implement global var using attr of function
  详细解决方案

python-implement global var using attr of function

热度:25   发布时间:2023-12-22 16:23:44.0

def  test():

      try:

            test.count+=1

     except  AttributeError:

            test.count =1 

       pass

test()

test()

test()

  相关解决方案