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.
Checks if all elements in a list are equal.
Checks if all the values in a list are unique.
Generates a list of numbers in the arithmetic progression starting with the given positive integer and up to the specified limit.
Calculates the average of two or more numbers.
Calculates the number of ways to choose
k
items fromn
items without repetition and without order.Returns the length of a string in bytes.
Capitalizes the first letter of every word in a string.
Clamps
num
within the inclusive range specified by the boundary values.Removes falsy values from a list.
Counts the occurrences of a value in a list.
Calculates the day difference between two dates.
Converts an angle from degrees to radians.
Calculates the difference between two iterables, without filtering duplicate values.
Converts a number to a list of digits.
Returns a list with
n
elements removed from the left.