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, List
Returns a list of elements that exist in both lists.
Python, List
Checks if the elements of the first list are contained in the second one regardless of order.
Python, List
Returns the last element in a list.
Python, String
Checks if the given string is a palindrome.
Python, List
Returns every element that exists in any of the two lists once.
Python, Date
Calculates the date of n
days from the given date.
Python, Math
Clamps num
within the inclusive range specified by the boundary values.
Python, Math
Checks if the given number falls within the given range.
Python, Math
Checks if the provided integer is a prime number.
Python, String
Pads a given number to the specified length.
Python, String
Returns the length of a string in bytes.
Python, String
Capitalizes the first letter of every word in a string.
Python, String
Generates a string with the given string value repeated n
number of times.
Python, Math
Calculates the factorial of a number.
Python, Math
Calculates the number of ways to choose k
items from n
items without repetition and without order.