Tag: iteration

Jack and the Beanstalk


In the English fairy tale, Jack and the beanstalk, Jack is a young, poor boy living with his mother and a dairy cow on a farm cottage. The cow’s milk is their only source of income. When the cow stops

Number 2520?


Did you know that 2520 is the smallest number exactly divisible by all integers from 1 to 10. The aim of this challenge is to write a python script to work out this number from its definition. Note that a

Higher or Lower Number Game


For this challenge you will design and write a program to play against the computer. The computer will display a random number between 1 and 100. The user will have to try to guess this number. For each guess the

The missing key


The aim of this challenge is to write a computer program that will take two whole numbers (integers) as input and output the result of multiplying these two numbers together. However, to make this task more challenging, you have to

Pomodoro Timer


The Pomodoro Technique is a time management method that can be used for a wide range of tasks. Many students use this technique to organise their revision time before an exam. This Pomodoro Technique was developed by Francesco Cirillo in

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