List difference
Calculates the difference between two iterables, without filtering duplicate values.
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.
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.
Learn two ways to format a string in Python with this quick tip.
Converts a string to kebab case.
Converts the values of RGB components to a hexadecimal color code.
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.
Creates a dictionary with the same keys as the provided dictionary and values generated by running the provided function for each value.
Returns the maximum 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 minimum value of a list, after mapping each element to a value using the provided function.
Splits a multiline string into a list of lines.
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.
Finds all keys in the provided dictionary that have the given value.
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.
Finds and returns the list of prime factors of a number.
Learn everything you need to know about Python's slice notation with this handy guide.