Guest User

Untitled

a guest
Oct 25th, 2010
31
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Parrot(object):
  2.     def __init__(self):
  3.         self._voltage = 100000
  4.  
  5.     @property
  6.     def voltage(self):
  7.         """Get the current voltage."""
  8.         return self._voltage
  9.  
  10. if __name__ == "__main__":
  11.     x=Parrot()
  12.     print x.voltage
  13.     x.voltage=100
RAW Paste Data