Understanding Python's slice notation
Learn everything you need to know about Python's slice notation with this handy guide.
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.
Learn everything you need to know about Python's slice notation with this handy guide.
Checks if the provided function returns True
for at least one element in the list.
Flattens a list, by spreading its elements into a new list.
Combines two lists into a dictionary, using the first one as the keys and the second one as the values.
Deep flattens a list.
Converts a dictionary to a list of tuples.
Executes the provided function once for each list element.
Returns a list of indexes of all the occurrences of an element in a list.
Check if two iterables are permutations of each other.
Creates a flat list of all the keys in a flat dictionary.
Returns the least common multiple of a list of numbers.
Returns the powerset of a given iterable.
Learn everything you need to know about Python's slice assignment with this handy guide.
Returns the weighted average of two or more numbers.
Removes falsy values from a list.
Flattens a list of lists once.
Returns the most frequent element in a list.
Reverses a list or a string.
Returns a list of elements that exist in both lists.
Checks if two lists contain the same elements regardless of order.
Returns the index of the element with the maximum value in a list.
Moves the specified amount of elements to the end of the list.
Moves the specified amount of elements to the start of the list.
Returns a random element from a list.