dberube4

a

Nov 17th, 2012
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.22 KB | None | 0 0
  1. class foo():
  2.     def __init__(self):
  3.     self.bacon = 'burned' #Variable 'bacon' is now stored inside the object
  4.     print('foo inited!')
  5.     self.taste()
  6.     def taste(self):
  7.     print self.bacon
  8.  
  9. obj = foo()
  10. print obj.bacon
Advertisement
Add Comment
Please, Sign In to add comment