Advertisement
ijontichy

derp2.py

Feb 4th, 2013
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. #!/usr/bin/env python3
  2.  
  3. class Person(object):
  4.     def __init__(self, name, loves):
  5.         self.name  = name
  6.         self.loves = loves
  7.  
  8.     def __str__(self):
  9.         return str(self.name)
  10.  
  11. jimmy    = Person("Jimmy",    None)
  12. shevonne = Person("Shevonne", jimmy)
  13. jimmy.loves = shevonne
  14.  
  15. print("{} loves {}".format(jimmy, jimmy.loves))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement