smith theelements set roberts theelements "csci- "csci- set "pol- "pol- "math- "math- "anth- "anth- "hist- "hist- "csci- "csci- "econ- "econ- "econ- "econ- figure two instances of the set class implemented as list listing the linearset py module implementation of the set adt container using python list class set creates an empty set instance def __init__self )self _theelements list(returns the number of items in the set def __len__self )return lenself _theelements determines if an element is in the set def __contains__selfelement )return element in self _theelements adds new unique element to the set def addselfelement )if element not in self self _theelements appendelement removes an element from the set def removeselfelement )assert element in self"the element must be in the set self _theelements removeitem determines if two sets are equal def __eq__selfsetb )if lenself !lensetb return false else return self issubsetofsetb (listing continued