A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2005-September/336316.html below:

is there a better way to check an array?

is there a better way to check an array? is there a better way to check an array?Mike Meyer mwm at mired.org
Thu Sep 1 23:25:20 EDT 2005
"Steve M" <sjmaster at gmail.com> writes:
> You can check for membership in a list at least these ways:

Two ways - idnex and the in keyword.

> 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.

      <mike
-- 
Mike Meyer <mwm at mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

More information about the Python-list mailing list

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