Mike Meyer wrote: > "Steve M" <sjmaster at gmail.com> writes: >>my_list.find(candidate) >>-returns the index into my_list of the first occurrence of candidate. >>Returns -1 if candidate doesn't occur in my_list. > > Lists don't have a find method. strings do. Why is a good question. Probably because at one point lists didn't even have the index() method, and when it was suggested and (I believe) Raymond H. added it, I suspect nobody also suggested that implementing find() was a good idea so it wasn't done. And, given both that index() exists and the recent discussion about the potential problems caused by find() returning a valid slice index when it fails, maybe it's _not_ a good idea... -Peter
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4