Set up Python 3 and pip 3 as default
A very common problem when working with Python is having to remember the correct version. Luckily, there's an easy fix for that.
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.
A very common problem when working with Python is having to remember the correct version. Luckily, there's an easy fix for that.
Pads a string on both sides with the specified character, if it's shorter than the specified length.
Returns the index of the element with the minimum value in a list.
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.
Initializes a list containing the numbers in the specified range where start
and end
are inclusive with their common difference step
.
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.
Returns every nth
element in a list.
Returns a list with n
elements removed from the left.
Returns a list with n
elements removed from the right.
Performs right-to-left function composition.
Performs left-to-right function composition.
Returns the unique elements in a given list.
Transposes a two-dimensional list.
Learn 3 easy ways to swap the values of two variables in Python.
Calculates the month difference between two dates.
Curries a function.
Creates a function that will invoke a predicate function for the specified property on a given dictionary.
Tests a value, x
, against a testing function, conditionally applying a function.
Returns every element that exists in any of the two lists once.
Oftentimes you might need to trim whitespace from a string in Python. Learn of three different way to do this in this short guide.
Returns the last element in a list.
Checks if the given date is a weekend.
Checks if the given date is a weekday.
Checks if the elements of the first list are contained in the second one regardless of order.