Prime Numbers in Python

In this article we are going to look a some different ways to check whether a number is prime using Python. As well as being an interesting and useful exercise, this exploration...

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 Venn Diagrams

In this article we are going to look at how to create Venn Diagrams with Python. Venn Diagrams are a great invention and are a really handy way to reason about sets....

Plotting Polynomials with Python

I’ve been enjoying reading A Programmer’s Introduction to Mathematics by Jeremy Kun recently. After the introduction, the first main topic it covers is a neat trick for sharing secrets (encrypting messages) so...