## Python Off-by-One Errors

Off-by-one errors are a type of logic error in Python programming, which are surprisingly common and can easily trip you up until you gain the habit of thinking really carefully about you...

Lists are a powerful and versatile data structure in Python which are used in many contexts.

Off-by-one errors are a type of logic error in Python programming, which are surprisingly common and can easily trip you up until you gain the habit of thinking really carefully about you...

CSV, or comma-separated values, is a simple file format for storing tabular data. It’s a popular format for data interchange, as it’s easy to read and write and it’s supported by a...

In this article we will look at how to use Python to determine whether two indices in a list are adjacent. Say you have a list like in the image, where the...

Checking whether two strings are anagrams of each other is a fairly common coding challenge or kata. At a local meetup recently, we looked at an extended version of the challenge: not...

Here’s a fun Python coding challenge that can be adapted to different levels of ability. Remember the game Duck Duck Goose from school? You sit in a circle and one player walks...

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

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

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

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

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

© 2019 Compucademy™ All Rights Reserved. Terms and Conditions