Find the key of the min or max value in a Python dictionary
Find the key of the minimum or maximum value in a Python dictionary.
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.
Find the key of the minimum or maximum value in a Python dictionary.
Initializes and fills a list with the specified value.
Initializes a 2D list of given width and height and value.
Combines two lists into a dictionary, using the first one as the keys and the second one as the values.
Converts a string to a URL-friendly slug.
Learn everything you need to know about Python's slice assignment with this handy guide.
Returns a random element from a list.
Reverses a number.
Check if two iterables are permutations of each other.
Returns a list of indexes of all the occurrences of an element in a list.
Executes the provided function once for each list element.
Finds all keys in the provided dictionary that have the given value.
Deep flattens a list.
Decapitalizes the first letter of a string.
Capitalizes the first letter of a string.
Returns the weighted average of two or more numbers.
Returns a list of elements that exist in both lists.
Returns the powerset of a given iterable.
Returns the most frequent element in a list.
Returns the least common multiple of a list of numbers.
Checks if a string is an anagram of another string (case-insensitive, ignores spaces, punctuation and special characters).
Python provides two distinct comparison operators for different task. Stop mixing them up using this quick guide.
Calculates the Hamming distance between two values.
Calculates the greatest common divisor of a list of numbers.