Tag: iteration

The Honeycomb Challenge

Honeycomb is a structure of hexagonal cavities (cells of wax), made by bees to store honey and eggs. In this challenge we will use a set of iterative algorithms to draw a honeycomb pattern. First, we will create a function

Recursive vs. Iterative Palindrome Check

For this challenge we will investigate two algorithms used to find out if a word is a palindrome or not. The first algorithm will use an iterative approach, the second algorithm will use a recursive approach. Iterative Approach An iterative

Triangular Numbers

A triangular number correspond to the number of dots that would appear in an equilateral triangle when using a basic triangular pattern to build the triangule. The triangular numbers sequence contains all the triangular numbers in order. The first 10

Happy New Year Animation

In this challenge we will use Python code to create a text-based (ASCII) animation to be used as a final countdown before the new year! Our countdown timer will be based on a for loop to count down from 5

Text Based Animations

In this challenge we will use Python code to create text-based (ASCII) animations. Each of these animations is using a main loop that repeats the given code every 0.2 seconds and clear the screen between two iterations (frames). Check our

Splash Screen and Progress Bar

Adding a Splash Screen to your Python Projects A splash screen usually appears for a few seconds while a game or program is launching. It can contain basic information such as the name of the game and its version number.

Estimating Pi using the Monte Carlo Method

One method to estimate the value of π (3.141592…) is by using a Monte Carlo method. This methods consists of drawing on a canvas a square with an inner circle. We then generate a large number of random points within

Insertion Sort Algorithm

The Insertion sort algorithm is one of the key sorting algorithms used in Computer Science. To start with, the algorithm considers the first value of a list as a sorted sub-list (of one value to start with). This iterative algorithm

Bubble Sort Algorithm

The Bubble sort algorithm is one of the key sorting algorithms used in Computer Science. It is a fairly simple algorithm to implement and is particularly useful when you need to find the top x values of a list. The

Min, Max, Mean, Median and Mod

In this Python challenge we will manipulate a list of numbers to calculate the Min, Max, Mean, Median and Mod of all these numbers. First you may want to refresh your maths skills and check the meaning of these terms: