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.
Python, String
Converts a hexadecimal color code to a tuple of integers corresponding to its RGB components.
Python, Math
Converts a number to a list of digits.
Python, List
Finds the items that are parity outliers in a given list.
Python, String
Converts the values of RGB components to a hexadecimal color code.
Python, Math
Returns the sum of the powers of all the numbers from start
to end
(both inclusive).
Python, Math
Converts an integer to its roman numeral representation.
Accepts value between 1
and 3999
(both inclusive).
Python, Math
Calculates the average of a list, after mapping each element to a value using the provided function.
Python, Math
Returns the maximum value of a list, after mapping each element to a value using the provided function.
Python, Math
Finds the median of a list of numbers.
Python, Math
Returns the minimum value of a list, after mapping each element to a value using the provided function.
Python, Math
Calculates the sum of a list, after mapping each element to a value using the provided function.
Python, Math
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, List
Returns the n
maximum elements from the provided list.
Python, List
Returns the n
minimum elements from the provided list.
Python, Math
Reverses a number.