Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class foo():
- def __init__(self):
- self.bacon = 'burned' #Variable 'bacon' is now stored inside the object
- print('foo inited!')
- self.taste()
- def taste(self):
- print self.bacon
- obj = foo()
- print obj.bacon
Advertisement
Add Comment
Please, Sign In to add comment