Find matching index
Finds the index of the first element in the given list that satisfies the provided testing function.
The Python snippet collection contains helper functions for Python 3.6. It includes utilities for most common data types, such as primitivies, lists, dictionaries and date objects.
Finds the index of the first element in the given list that satisfies the provided testing function.
Finds the index of the last element in the given list that satisfies the provided testing function.
Learn how Python's lists and tuples are different and level up your code today.
Learn how to sort a Python dictionary list using a tuple key.
Chunks a list into n
smaller lists.
Chunks a list into smaller lists of a specified size.
Finds the value of the last element in the given list that satisfies the provided testing function.
Finds the items that are parity outliers in a given list.
Finds the value of the first element in the given list that satisfies the provided testing function.
Calculates the difference between two iterables, without filtering duplicate values.
Creates a dictionary with the unique values of a list as keys and their frequencies as the values.
Returns the symmetric difference between two iterables, without filtering out duplicate values.
Calculates the average of a list, after mapping each element to a value using the provided function.
Initializes a list containing the numbers in the specified geometric progression range.
Takes any number of iterable objects or objects with a length property and returns the longest one.
Returns the maximum value of a list, after mapping each element to a value using the provided function.
Returns the minimum value of a list, after mapping each element to a value using the provided function.
Calculates the sum of a list, after mapping each element to a value using the provided function.
Checks if the provided function returns True
for every element in the list.
Executes the provided function once for each list element, starting from the list's last element.
Initializes a 2D list of given width and height and value.
Initializes and fills a list with the specified value.
Returns the n
maximum elements from the provided list.
Returns the n
minimum elements from the provided list.