Exploring Shapes with Python: Sphere

A sphere is a fundamental geometric shape that often finds applications in mathematics, physics, computer graphics, and engineering. It’s defined as the set of all points in three-dimensional space equidistant from a...

Exploring Complex Numbers with Python

Complex numbers are an extension of the real numbers, consisting of a real and an imaginary part. They are useful in many mathematical and scientific applications, including electrical engineering, physics, and signal...

Power Sets with Python

A power set is the set of all possible subsets of a set. For example, if we have a set containing [A, B, C] the possible subsets are: [[], ['A'], ['B'], ['A',...

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...