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

## Fizz Buzz Coding Challenge in Python

Fizz Buzz is a classic coding challenge based on a game played at school in Maths lessons. Fizz Buzz is a game for two or more players. Take it in turns to...

## Python Loops and Flowcharts

In this lesson we are going to learn how to convert between Python code and flowchart representations of loops when designing algorithms. Consider the following code. As with most code examples in...

## Introduction to HackerRank for Python Programmers

HackerRank is a site where you can supercharge your Python programming skills, master data structures and algorithms, and stand out to prospective employers by solving challenges alongside programmers from all around the...

## Coins on a Star Puzzle with p5.js

Here’s a fun puzzle for you, which I have implemented online using the fantastic p5.js library for creative coding. The goal is to place as many coins on the board as possible...

## Python Programming Challenge – Validate ISBN-10 Number

ISBN Numbers, or International Standard Book Numbers are commercial numeric book identifiers which are used to uniquely identify a publication. There are two types of ISBN numbers – ISBN-10 and ISBN-13. Validation...

## Python Programming Challenge – Counting Pairs

Here’s a fun algorithmic challenge for you. Given a list of integers, write a function to find the total number of complete pairs contained in the list. For example: for the input...

## Algorithmic Thinking with Python part 3 – Divide and Conquer Strategy

Divide and Conquer is a very powerful technique for solving computational problems. In the last article in this series, we looked at decrease and conquer, which is included by some authors under...

## Algorithmic Thinking with Python part 1 – Brute Force Algorithms

Many computational problems can be solved by trying all possible candidate solutions until the correct solution to the problem is found. This approach is often called Exhaustive Search or Brute Force Search....

## Musical Bubble Sort in Python

I am a firm believer in offering a wide variety of perspectives on the topics I teach in Computer Science. I also like to make connections between Computer Science and other subjects....