Advertisement
Guest User

Untitled

a guest
Nov 29th, 2014
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.17 KB | None | 0 0
  1. def p():
  2.     #print the value of value1
  3.     print(p.__dict__.get('value1',0))
  4.  
  5. def q():
  6.     #increase the value of value1 +1
  7.     p.value1 = getattr(p,'value1',0) + 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement