Integer to roman numeral
Converts an integer to its roman numeral representation.
Accepts value between 1
and 3999
(both inclusive).
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.
Converts an integer to its roman numeral representation.
Accepts value between 1
and 3999
(both inclusive).
Calculates the average of a list, after mapping each element to a value using the provided function.
Calculates the difference between two iterables, without filtering duplicate values.
Creates a dictionary with the unique values of a list as keys and their frequencies as the values.
Initializes a list containing the numbers in the specified geometric progression range.
Converts a string to kebab case.
Takes any number of iterable objects or objects with a length property and returns the longest one.
Returns the maximum value of a list, after mapping each element to a value using the provided function.
Finds the median of a list of numbers.
Returns the minimum value of a list, after mapping each element to a value using the provided function.
Sorts the given dictionary by key.
Calculates the sum of a list, after mapping each element to a value using the provided function.
Returns the symmetric difference between two iterables, without filtering out duplicate values.
Checks if the provided function returns True
for every element in the list.
Executes the provided function once for each list element, starting from the list's last element.
Returns the n
maximum elements from the provided list.
Returns the n
minimum elements from the provided list.
Learn everything you need to know about Python's slice notation with this handy guide.
Checks if the provided function returns True
for at least one element in the list.
Splits a multiline string into a list of lines.
Initializes a 2D list of given width and height and value.
Initializes and fills a list with the specified value.
Find the key of the minimum or maximum value in a Python dictionary.
Creates a dictionary with the same keys as the provided dictionary and values generated by running the provided function for each value.