(self, value)
L.index(value) -> integer -- return first index of value.
        Raises ValueError if the value is not present.
L.index(value) -> integer -- return first index of value.
        Raises ValueError if the value is not present.
L . index ( value ) - > integer -- return first index of value . Raises ValueError if the value is not present .
def index(self, value):
        """L.index(value) -> integer -- return first index of value.
        Raises ValueError if the value is not present."""

        for position, entry in enumerate(self):
            if value == entry:
                return position
        else:
            raise ValueError(f"{value!r} not in this container")
def index ( self , value ) : for position , entry in enumerate ( self ) : if value == entry : return position else : raise ValueError ( f"{value!r} not in this container" )