sequences pylist length def __len__(self)return self numitems if the number of items were not kept track of within the pylist objectthen counting the number of items in the list would be (noperation insteadif we keep track of the number of items in the list as items are appended or deleted from the listthen we need only return the value of numitems from the objectresulting in ( complexity pylist membership def __contains__(self,item)for in range(self numitems)if self items[ =itemreturn true return false testing for membership in list means checking to see if an item is one of the items in the list the only way to do this is to examine each item in sequence in the list if the item is found then true is returnedotherwise false is returned this results in (ncomplexity this idea of searching for an item in sequence is so common that computer scientists have named it this is called linear search it is named this because of its (ncomplexity pylist string conversion def __str__(self) "[for in range(self numitems) repr(self items[ ]if self numitems " "]return it is convenient to be able to convert list to string so it can be printed python includes two methods that can be used for converting to string the first you are probably already familiar with the str function calls the __str__ method on an object to create string representation of itself suitable for printing here is code that implements the __str__ method for the pylist class this copy belongs to 'acha