ReferenceList methods
list.index()
The position of the first matching item.
Signature
items.index(value)Parameters
| Name | Means |
|---|---|
value | what to look for |
Returns
An int. Raises ValueError when there is no match.
Example
Python
names = ["Ada", "Grace", "Ada"]
print(names.index("Ada"))
print("Alan" in names)Output
0 False