Snakecase string
Converts a string to snake case.
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 a string to snake case.
Checks if the provided function returns True
for at least one element in the list.
Capitalizes the first letter of a string.
Decapitalizes the first letter of a string.
Reverses a number.
Converts a string to a URL-friendly slug.
Flattens a list, by spreading its elements into a new list.
Combines two lists into a dictionary, using the first one as the keys and the second one as the values.
It's generally not a good idea to use bare except
clause in Python, but do you know why?
Deep flattens a list.
Converts a dictionary to a list of tuples.
Executes the provided function once for each list element.
Calculates the greatest common divisor of a list of numbers.
Python provides two distinct comparison operators for different task. Stop mixing them up using this quick guide.
Returns a list of indexes of all the occurrences of an element in a list.
Checks if a string is an anagram of another string (case-insensitive, ignores spaces, punctuation and special characters).
Check if two iterables are permutations of each other.
Creates a flat list of all the keys in a flat dictionary.
Returns the least common multiple of a list of numbers.
Returns the powerset of a given iterable.
Learn everything you need to know about Python's slice assignment with this handy guide.
Returns the weighted average of two or more numbers.
Removes falsy values from a list.
Learn the difference between two common ways to access values in Python dictionaries and level up your code today.