diff --git a/README.md b/README.md index 99efd7f..be0d076 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ list_of_chars = list() ``` ```python + = .count() # Returns number of occurrences. Also works on strings. index = .index() # Returns index of first occurrence or raises ValueError. .insert(index, ) # Inserts item at index and moves the rest to the right. = .pop([index]) # Removes and returns item at index or from the end. diff --git a/index.html b/index.html index a2fda15..8d152a8 100644 --- a/index.html +++ b/index.html @@ -249,7 +249,8 @@ flatter_list = list(itertools.chain.from_iterable(<list>)) product_of_elems = functools.reduce(lambda out, x: out * x, <collection>) list_of_chars = list(<str>) -
index = <list>.index(<el>)     # Returns index of first occurrence or raises ValueError.
+
<int> = <list>.count(<el>)     # Returns number of occurrences. Also works on strings.
+index = <list>.index(<el>)     # Returns index of first occurrence or raises ValueError.
 <list>.insert(index, <el>)     # Inserts item at index and moves the rest to the right.
 <el> = <list>.pop([index])     # Removes and returns item at index or from the end.
 <list>.remove(<el>)            # Removes first occurrence of item or raises ValueError.