Have you ever played the board game “Mastermind”? If you are not too sure about the rules of this game, you should first check this page. For this challenge we are going to create this game of mastermind where the…
Learning Objectives In this challenge we are going to focus on accessing a text file in Python to read the content of the file line by line. Challenge Your first challenge consists of writing a Python script that will read…
In most of your Python programs you will want to interact with the end-user by asking questions and retrieving user inputs. To do so you can use the input() function: e.g. username=input("What is your username?") Sometimes you will need to…
Learning Objectives In this challenge we are going to focus on accessing a text file in Python to: Read the content of the file line by line, Append data at the end of the file, Write into a new text…
The aim of this blog post is to create a countdown timer that will display the numbers on screen using a 7-segment display. A lot of electronic devices use this approach to display numbers on a LED or LCD screen.…
First, let’s watch this short video clip from the movie Home Alone 2. This video clip highlights a typical case of recursion. Recursive Functions A recursive function is a function which calls itself. To make sure that a recursive function…
“The Twelve Days of Christmas” is an English Christmas carol that enumerates in the manner of a cumulative song a series of increasingly grand gifts given on each of the twelve days of Christmas. Let’s look at how we could…