In the second book of the Harry Potter Series, “The Chamber of Secrets” by J.K. Rowling, Harry Potter finds out that he can communicate with snakes using the Parseltongue language. In this challenge we will write a Python script to…
In this challenge we will implement an algorithm to be used in an Automatic Petrol Pump to interact with the customer and calculate the total cost of filling up their vehicle. The fuel options and tariffs at this petrol station…
An ATM, a.k.a. Cash Withdrawal Machine, uses a computer program to interact with the customer and count the number of banknotes to dispense based on the customer’s requested amount. In the UK, ATM’s tend to only stock £20 banknotes and…
In this challenge we have created a client-side script using HTML, CSS and JavaScript to help a Maths teacher create homework worksheets for their class. Our HTML page uses a web form, for the teacher to select various options based…
Prolog is a language built around the Logical Paradigm: a declarative approach to problem-solving. There are only three basic constructs in Prolog: facts, rules, and queries. A collection of facts and rules is called a knowledge base (or a database)…
This page summarises the syntax of the Python language. When using Python always remember two key rules: Rule #1: Python is white-space dependent; code blocks are indented using spaces. Rule #2: Python language is case sensitive. It matters for variables,…
Othello (a.k.a. Reversi) is a strategy board game for two players, played on an 8×8 board. There are sixty-four identical game pieces called discs which are white on one side and black on the other. Players take turns placing discs…
Moroccan mosaic, aka Zellige (الزليج), is a form of Islamic art and one of the main characteristics of Moroccan architecture. It consists of geometrically patterned mosaics, used to ornament walls, ceilings, fountains, floors, pools and tables. Each mosaic is a…
In this challenge we will use Python Turtle to draw regular polygons including: An equilateral triangle A square A pentagon An hexagon etc. Did you know? In Euclidean geometry, a regular polygon is a polygon that is equiangular (all angles…
The first instruction you will most likely learn when using Python is the print() instruction. It is used to display/output a message on screen. print("Hello World") Using Variables The print command can be used to output the content of a…