View Post

How to get the key with the maximum value in a dictionary?

I have spent my morning hours with an important mission: finding the cleanest, fastest, and most concise answer to this question. I realized that many answers on the web use libraries which is not necessary for this simple problem. In short: use the max function with the key argument. It’s a simple but powerful solution to get the key from …

View Post

How to check your Python version?

Simple Answer: To check your Python version, run the command python –version in your command line. This general method works across all major operating systems. In the following, I will show you exactly how to check your Python version for different operating systems. Do you struggle with learning Python? Join my free Python Email Course! My subscribers love it. Check …

View Post

Numpy Tutorial – Everything You Need to Know to Get Started with Numpy

This tutorial gives you a simple introduction to Python’s numpy library. You don’t need any prerequisites to follow the tutorial. My goal was to give a practical and fun numpy introduction for absolute beginners and with many examples. By reading through this tutorial, you will gain a basic understanding of the most important numpy functionality. Moreover, I will give you …

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 topic …

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 will …

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: abc = "abcdefghijklmnopqrstuvwxyz" "".join([abc[(abc.find(c)+13)%26] for c in x]). This Python library call does ROT13 encryption in Python: import codecs codecs.encode(phrase, 'rot_13'). What is ROT13? The ROT13 algorithm is a simple encryption algorithm. …