def extend ( self , item ) : if not isinstance ( item , list ) : raise TypeError ( 'You can only extend lists with lists. ' 'You supplied \"%s\"' % type ( item ) ) for entry in item : if not isinstance ( entry , str ) : raise TypeError ( 'Members of this object must be strings. ' 'You supplied \"%s\"' % type ( entry ) ) list . append ( self , entry )
how do you extend a list in python
Extend the list with another list . Each member of the list must be a string .
def extend(self, item):
        """Extend the list with another list. Each member of the list must be
        a string."""
        if not isinstance(item, list):
            raise TypeError(
                'You can only extend lists with lists. '
                'You supplied \"%s\"' % type(item))
        for entry in item:
            if not isinstance(entry, str):
                raise TypeError(
                    'Members of this object must be strings. '
                    'You supplied \"%s\"' % type(entry))
            list.append(self, entry)