The Most Pythonic Way to Join a List in Reverse Order

The most efficient method to join a list of Python strings in reverse order is to use the Python code ”.join(l[::-1]). First, reverse the list l using slicing with a negative step size l[::-1]. Second, glue together the strings in the list using the join(…) method on the empty string ”. Problem: Given a list … Read more

Complexity of Python Operations

In this tutorial, you’ll learn the runtime complexity of different Python operations. Then, you’ll learn how to calculate the complexity of your own function by combining the complexity classes of its constituents. This is called “static analysis” The tutorial is loosely based on (source) but it extends it significantly with more practical examples, interactive snippets, … Read more