PYTHON USER INPUT

User input is one of the things which makes Python programming powerful and interesting, as it provides interactivity. This article shows you how to make Python ask for input from the user...

PYTHON LOOP INVARIANTS

Writing robust code is always a good idea, but is particularly important for mission critical contexts, such as where safety is an issue. There are several historical examples of where faulty code...

TRIANGLE NUMBERS WITH PYTHON

This post explores some different ways of generating the famous Triangle Numbers with Python. Before reading on, have a go a writing some Python code to print out the first 10 Triangle...

PYTHON FUNCTIONS

Functions are a very important aspect of Python programming. They provide a way to structure your code meaningfully and also to make parts of it reusable. Think of a function as being...

Python Loops

The ability to repeat tasks many times in rapid succession is one of the things which makes computers so useful. In programming, the technical word for repeating things is iteration. This is...

Selection Sort with Python

In this article we are going to learn how to implement Selection Sort with Python. Selection Sort is a simple and intuitive sorting algorithm. It can be performed using an auxiliary array...

Pseudocode

Not all algorithmic thinking occurs in front of a monitor with a keyboard at hand. In fact, it is often the case that the more complex an algorithm is, the more benefit...

Algorithm Animations

If a picture is worth 1000 words, an animation is worth even more! Fully understanding an algorithm can be hard, and it is helpful to be able to reason about it in...

Python Debugging

Sometimes when debugging Python code, it is useful to be able to see the values of the variables at each step in its execution. This can be done with a debugging tool...