View Post

What is the Asterisk / Star Operator (*) in Python?

The asterisk operator in Python has 6 different meanings: (*)  Multiplication, (**) Exponentiation, (*)  Creating container types, (*)  Unpacking 1: Define an arbitrary number of positional arguments, (**) Unpacking 2: Define an arbitrary number of keyword arguments, and (**) Unpacking a container type (e.g. dictionary). After reading this article, you will have a solid understanding of a small but important …

View Post

101+ Free Python Books

Spending money on books is one of the best investments you can possibly make. But why should you? This article compiles a list of 101++ FREE Python books to smash any excuse of not learning Python because one cannot afford to buy Python books. How to use this list? Most likely you don’t belong to the 0.01% of nerds who …

View Post

10 Best Python Puzzles to Discover Your True Skill Level

Do you belong to the top 50% of Python coders? This article poses you 10 intermediate-level Python puzzles to test yourself. By solving all 10 Python puzzles and tracking your success rate, you will discover your exact Python skill level. How to do this? The idea of solving rated Python puzzles to measure your skill level is inspired by the …

View Post

A Simple Introduction to List Comprehension in Python

List comprehension is a compact way of creating lists. The simple formula is [ expression + context ]. Expression: What to do with each list element? Context: What list elements to select? It consists of an arbitrary number of for and if statements. The example [x for x in range(3)] creates the list [0, 1, 2]. In this article, you …

View Post

{Brackets} A Simple Introduction to Set Comprehension in Python

In this article, I give you everything you need to know about set comprehensions using the bracket notation {}. An example for set comprehension is the bracket notation {x for x in range(10)} to create the set {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}. Being hated by newbies, experienced Python coders can’t live without this awesome Python …

View Post

How to Create Alexa Skills in Python? A Simple Overview for Beginners.

Alexa is on the way to lead the next wave of technological disruption. Have you ever asked yourself about the exact steps needed to create an Alexa Skill? And how these steps interplay with each other? To answer these questions, I give you a quick overview of Alexa Skill development in Python. This article serves as a first starting point …

View Post

How to use ROT13 in Python? Simply Explained

ROT13 is a simple encryption method that shifts the string x (clear text) by 13 positions in the alphabet. This simple Python one-liner does ROT13 encryption for you: This Python library call does ROT13 encryption in Python: What is ROT13? The ROT13 algorithm is a simple encryption algorithm. It is used in many forums (for example Reddit) to prevent spoilers …

View Post

How (Not) to Use Regular Expressions in Python’s endswith()?

I am sitting in front of my computer refactoring my Python code and I am asking myself the following question. So I did a bit of research that I want to share with you. Is it possible to use a regular expression within the Python endswith() method? The short answer is no. In fact, I realized that using a regex …

View Post

You Cannot Use Python Regex in startswith(). Do This Instead.

I am sitting in front of my computer refactoring my Python code and I am asking myself the following question. Is it possible to use a regular expression within the Python startswith() method? The short answer is no. In fact, I realized that using a regex does not make any sense in combination with the startswith() method. Instead, use the …