Convert an integer to a roman numeral
Convert an integer to its roman numeral representation.
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.
Convert an integer to its roman numeral representation.
Find the sum of the powers of all the numbers from start
to end
(both inclusive).
Create a dictionary with the same keys as the provided dictionary and values generated by running the provided function for each value.
Find the key of the minimum or maximum value in a Python dictionary.
Convert a string to a URL-friendly slug, using Python and regular expressions.
Learn everything you need to know about Python's slice assignment with this handy guide.
Python provides two distinct comparison operators for different task. Stop mixing them up using this quick guide.
It's generally not a good idea to use bare except
clause in Python, but do you know why?
Move a specified amount of elements to the end of a list.
Learn the difference between two common ways to access values in Python dictionaries and level up your code today.
Find the byte size of a Python string, containing special characters or not.
Here are two quick and elegant ways to check if a string is empty in Python.
A very common problem when working with Python is having to remember the correct version. Luckily, there's an easy fix for that.
Learn of the two different ways to convert strings to lowercase in Python and understand when you should use each one with this quick guide.
Learn how to perform some very common operations on Python lists, such as getting the first, last, initial, head, and tail elements.
When working with files in Python, it's important to ensure that the file is closed correctly. Here are a couple of ways to do that.
Learn 3 easy ways to swap the values of two variables in Python.
Calculates the day, month, or year difference between two dates.
Checks if the given date is a weekend or a weekday.
Calculate dates relative to today or a given date by adding or subtracting days.
Oftentimes you might need to trim whitespace from a string in Python. Learn of three different way to do this in this short guide.
Calculate the number of ways to choose k
items from n
items without repetition and without order.
Understand what one of the most commonly used Python constructs does and when you should use it.