I'm trying to print the list created by the functions in this class- what do I need to fix? I'm getting output from the terminal along the lines of [<__main__.Person instance at 0x1004a0320>,
.
class Person:
def __init__(self,first,last,id,email):
self.firstName=first
self.lastName=last
self.id=id
self.email=email
self.friends=[]
def add_friend(self,friend):
if len(self.friends)<5:
self.friends.append(friend)
if len(friend.friends)<5:
friend.friends.append(self)
p1=Person("David","Waver","922-43-9873","dwaver@wsu.edu")
p2=Person("Bob","Jones","902-38-9973","bjones@odu.edu")
p3=Person("James","Smith","302-38-9103","jonsdfes@ou.edu")
p4=Person("Tim","Jack","902-38-0918","remmy@usc.edu")
p5=Person("Jim","Johnston","314-78-2343","jjohnston@fsu.edu")
p6=Person("Gina","Relent","102-38-1064","ginar@wvu.edu")
p7=Person("Greg","Morris","932-38-4473","jones@ttu.edu")
p1.add_friend(p2)
p1.add_friend(p3)
p1.add_friend(p4)
p1.add_friend(p5)
p1.add_friend(p6)
p1.add_friend(p7)
print p1.friends