Tag: iteration

Recursive vs. Iterative Palindrome Check

palindrome-definition

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

triangular-number-10

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

happy-new-year-text

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

frame-based-animation

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

progress-bar-visualisation

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

pi-3-14159

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

Insertion-sort-1-9

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

Bubble-sort-1-9

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

maths-blackboard

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:

How old will you be in…

calendar-clock

In this challenge we will write a Python program to help us find out hold we will be in the coming years! We have designed the algorithm of our program using both a Flowchart and Pseudocode. Algorithm Reviewing the Algorithm