Split list into chunks
Chunks a list into smaller lists of a specified size.
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.
Chunks a list into smaller lists of a specified size.
Returns the symmetric difference between two iterables, without filtering out duplicate values.
Calculates the sum of a list, after mapping each element to a value using the provided function.
Sorts the given dictionary by key.
Returns the minimum value of a list, after mapping each element to a value using the provided function.
Finds the median of a list of numbers.
Returns the maximum value of a list, after mapping each element to a value using the provided function.
Takes any number of iterable objects or objects with a length property and returns the longest one.
Converts a string to kebab case.
Initializes a list containing the numbers in the specified geometric progression range.
Creates a dictionary with the unique values of a list as keys and their frequencies as the values.
Calculates the difference between two iterables, without filtering duplicate values.
Calculates the average of a list, after mapping each element to a value using the provided function.
Splits a multiline string into a list of lines.
Checks if the provided function returns True
for at least one element in the list.
Learn everything you need to know about Python's slice notation with this handy guide.
Returns the n
minimum elements from the provided list.
Returns the n
maximum elements from the provided list.
Executes the provided function once for each list element, starting from the list's last element.
Checks if the provided function returns True
for every element in the list.
Flattens a list, by spreading its elements into a new list.
Converts a string to snake case.
Finds and returns the list of prime factors of a number.
Creates a dictionary with the same keys as the provided dictionary and values generated by running the provided function for each value.