fork download
  1. def cool():
  2. d = {'x':0}
  3. def lal():
  4. d.update({'x':d['x']+1})
  5. return d['x']
  6. return lal
  7.  
  8. class Cl():
  9. n = 0
  10. def lol():
  11. Cl.n+=1
  12. return Cl.n
  13. lol = staticmethod(lol)
  14.  
  15. if __name__=='__main__':
  16. q = cool()
  17. w = Cl()
  18. print(w.lol())
  19. print(q())
Success #stdin #stdout 0.03s 9936KB
stdin
Standard input is empty
stdout
1
1