Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import pprint
- class Person:
- def __init__(self, name):
- self.name = name
- self.f = []
- def Name(self):
- return self.name
- def F(self,f):
- self.f.append(f)
- p1 = Person("Mike")
- p1.F("kode")
- p1.F("mad")
- p2 = Person("Diana")
- p2.F("film")
- p2.F("bittune")
- print(p1.Name())
- pprint.pprint(p1.f)
- print(p2.Name())
- pprint.pprint(p2.f)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement