Python Snippets
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.
Maps the values of a list to a dictionary using a function, where the key-value pairs consist of the original value as the key and the result of the function as the value.
Randomizes the order of the values of an list, returning a new list.
Learn everything you need to know about Python's slice assignment with this handy guide.
Returns the difference between two lists, after applying the provided function to each list element of both.
Creates a list with the non-unique values filtered out.
Creates a list with the unique values filtered out.
Retrieves the value of the nested key indicated by the given selector list from a dictionary or list.
Returns a list of elements that exist in both lists, after applying the provided function to each list element of both.
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.
Learn 3 easy ways to swap the values of two variables in Python.
Finds the index of the first element in the given list that satisfies the provided testing function.
Finds the indexes of all elements in the given list that satisfy the provided testing function.
Python provides two distinct comparison operators for different task. Stop mixing them up using this quick guide.