List symmetric difference based on function
Returns the symmetric difference between two lists, after applying the provided function to each list element of both.
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.
Returns the symmetric difference between two lists, after applying the provided function to each list element of both.
Returns every element that exists in any of the two lists once, after applying the provided function to each element of both.
Converts a number to a list of digits.
Checks if the a value is an empty sequence or collection.
Mutable default arguments can trip up Python beginners and veterans alike. Here's a quick workaround to deal with them.
Understand Python's named tuples and start using them in your projects today.
Converts a list of dictionaries into a list of values corresponding to the specified key
.
Splits values into two groups, based on the result of the given filter
list.
Finds the indexes of all elements in the given list that satisfy the provided testing function.
Finds the index of the first element in the given list that satisfies the provided testing function.
Finds the index of the last element in the given list that satisfies the provided testing function.
Inverts a dictionary with unique hashable values.
Learn how Python's lists and tuples are different and level up your code today.
Merges two or more dictionaries.
Learn how to sort a Python dictionary list using a tuple key.
Chunks a list into n
smaller lists.
Chunks a list into smaller lists of a specified size.
Finds the value of the last element in the given list that satisfies the provided testing function.
Finds the items that are parity outliers in a given list.
Finds the value of the first element in the given list that satisfies the provided testing function.
Sorts the given dictionary by key.
Using str.lstrip()
to strip a prefix from a string might not be exactly what you're looking for. Here's what you should use instead.
Returns the sum of the powers of all the numbers from start
to end
(both inclusive).
Converts an integer to its roman numeral representation.
Accepts value between 1
and 3999
(both inclusive).