What mechanism is used that allows the built-in function list.remove
but not simply list.find
?
If I have a list l = [a,b,c...]
and want to remove an element, I don't need to know its index, I simply input l.remove(element)
. Why is it then that I can't use a similar command to find an element's index or to simply check if it's in the list?