Flatten list
Flattens a list of lists once.
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.
Flattens a list of lists once.
Converts a date from its ISO-8601 representation.
Calculates the Hamming distance between two values.
Returns the most frequent element in a list.
Reverses a list or a string.
Returns a list of elements that exist in both lists.
Converts a date to its ISO-8601 representation.
Generates a list of numbers in the arithmetic progression starting with the given positive integer and up to the specified limit.
Checks if two lists contain the same elements regardless of order.
Returns the index of the element with the maximum value in a list.
Maps a number from one range to another range.
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.
Returns a flat list of all the values in a flat dictionary.
Performs left-to-right function composition.
Performs right-to-left function composition.
Creates a list of partial sums.
Checks if all the elements in values
are included in lst
.
Checks if any element in values
is included in lst
.
Initializes a list containing the numbers in the specified range where start
and end
are inclusive with their common difference step
.
Finds the key of the maximum value in a dictionary.
Finds the key of the minimum value in a dictionary.
Learn of the two different ways to convert strings to lowercase in Python and understand when you should use each one with this quick guide.