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 two ways to format a string in Python with this quick tip.
Python, String · Jun 12, 2021
Calculates the difference between two iterables, without filtering duplicate values.
Python, List · Nov 2, 2020
Creates a dictionary with the unique values of a list as keys and their frequencies as the values.
Python, List · Nov 2, 2020
Checks if the a value is an empty sequence or collection.
Python, List · Jan 12, 2023
Returns the symmetric difference between two iterables, without filtering out duplicate values.
Python, List · Nov 2, 2020
Calculates the average of a list, after mapping each element to a value using the provided function.
Python, Math · Nov 2, 2020
Initializes a list containing the numbers in the specified range where start
and end
are inclusive and the ratio between two terms is step
.
Python, Math · Nov 2, 2020
Takes any number of iterable objects or objects with a length property and returns the longest one.
Python, List · Oct 17, 2021
Creates a dictionary with the same keys as the provided dictionary and values generated by running the provided function for each value.
Python, Dictionary · Nov 2, 2020
Returns the maximum value of a list, after mapping each element to a value using the provided function.
Python, Math · Nov 2, 2020
Returns the minimum value of a list, after mapping each element to a value using the provided function.
Python, Math · Nov 2, 2020