Python Challenge – 7 Puzzle

Here’s a fun little puzzle for you, which lends itself well to a Python coding solution. Find a two-digit positive integer that becomes 7 times smaller when its leftmost digit is removed....

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 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 OBJECT-ORIENTED PROGRAMMING

Object-Oriented programming is an essential skill for any serious Python programmer. It is one of the most important programming paradigms, and vast amounts of code exist which make use of it. GETTING...

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

Random Numbers with Python

Random numbers are very important in computing. Whenever you need to simulate something in the real world where the outcome is unknown, random numbers come into play. A classic example is their...