Unscramble the Word

It has been a while, but here is a short post for a simple game nonetheless. This game is called “Unscramble the Word”, where the player would be presented a 7-letter word that has been scrambled and would have to provide the unscrambled word as the correct answer to gain a point. A wrong answer […]

Password Generator.

If you are searching for ideas for a Python mini project on the internet, this would be one of the common search results. This is my take on a simple programme to generate passwords. A password that is considered to be of sufficient complexity typically consists of the following:– At least 1 upper case letter […]

Blackjack Score Calculator.

I was trying out some Python problems on Codewars (www.codewars.com) when I came across this interesting problem titled ‘Blackjack Scorer’ posted by a user called ‘jodymgustafson’. I find this problem interesting because there is a conditional involved when determining the value of an ‘Ace’ card, where it can either take a value of 1 or […]

Simple Financial Calculator.

In this post we will consider a simple financial calculator to see the effect of compounding interest, and also to estimate the number of years a particular sum of funds is able to last through retirement. The code will prompt the user to consider two scenarios, each with a starting amount, and the annual increment. […]

Assigning Exam Score.

Going one step back from the previous two posts (here and here), a Python code could be used to mark the answers submitted by students, returning the exam score for each student. With the data on hand, the distribution of the students’ choices for each question could be analysed, allowing the examiner to assess what […]

Assigning Exam Grades. Part II – Moderation

Following from the previous post, there might be instances where the user might need to change the cut-off scores for the various grades so that a desired percentage of students is obtained for each grade – also known as grade moderation. Let’s look at how the code from the previous post could be modified to […]

Assigning Exam Grades.

This post will be focusing on the bisect module available from Python. According to Python documentation, the bisect module provides support for maintaining a list in sorted order without having to sort the list after each insertion. This searching and insertion into a list can be used to assist with a common task that teachers/lecturers […]

Travelling Salesman Problem. A Brute Force Approach.

The travelling salesman problem asks the following question: “Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each city and returns to the origin city?” In the following post, the cities are represented by coordinates on a Cartesian plane. The distance (Euclidean distance) […]