diff --git a/native-datatypes.html b/native-datatypes.html index e008044..1393d9c 100755 --- a/native-datatypes.html +++ b/native-datatypes.html @@ -337,8 +337,8 @@ ZeroDivisionError: Fraction(0, 0) ValueError: list.index(x): x not in list
count() method returns the number of occurrences of a specific value in a list.
-in operator is slightly faster than using the count() method. The in operator always returns True or False; it will not tell you where in the list the value is.
-index() method. By default it will search the entire list, although you can specify a second argument of the (0-based) index to start from, and even a third argument of the (0-based) index to stop searching.
+in operator is slightly faster than using the count() method. The in operator always returns True or False; it will not tell you how many times the value appears in the list.
+in operator nor the count() method will tell you where in the list a value appears. If you need to know where in the list a value is, call the index() method. By default it will search the entire list, although you can specify an optional second argument of the (0-based) index to start from, and even an optional third argument of the (0-based) index to stop searching.
index() method finds the first occurrence of a value in the list. In this case, 'new' occurs twice in the list, in a_list[2] and a_list[4], but the index() method will return only the index of the first occurrence.
index() method will raise an exception.