Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- class Person(object):
- def __init__(self, name, loves):
- self.name = name
- self.loves = loves
- def __str__(self):
- return str(self.name)
- jimmy = Person("Jimmy", None)
- shevonne = Person("Shevonne", jimmy)
- jimmy.loves = shevonne
- print("{} loves {}".format(jimmy, jimmy.loves))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement