Copy/pasting the code breaks the formatting (at least removes blank lines). I know this is a platform problem, but maybe you could help by providing a link to a gist or some such?


In this article we are going to learn about Simpson’s Paradox and explore it with Python programming.

Simpson’s Paradox is where data appears to tell a different story when treated as a whole than when its component parts are considered. There are some famous cases of this paradox which you can read about on Wikipedia. The purpose of this article is to explore the paradox by means of a specific example and the use of Python programming.

The data for this example is taken from a YouTube video by a Harvard Lecturer as part of a Statistics 110 course. …


The Binary Search Algorithm is fundamental in Computer Science. It is a very clever algorithm which reduces the time needed to search for items in large datasets dramatically compared to less efficient approaches.

It is important to note that in order to use binary search, your data must be sorted. Some people get mixed up with sorting algorithms and searching algorithms, grouping them together in their thinking, but it is well worth taking a moment to organise your “algorithm toolkit” a little and make sure that searching and sorting each have their own section. …


Python Fizz Buzz Coding Challenge
Python Fizz Buzz Coding Challenge

Fizz Buzz is a classic coding challenge based on a game played at school in Maths lessons.

Fizz Buzz is a game for two or more players. Take it in turns to count aloud from 1 to 50, but each time you are going to say a multiple of 3, replace it with the word “fizz”. For multiples of 5, say “buzz” and for numbers which are multiples of both 3 and 5, say “fizz, buzz”.

Have a go at writing some Python code to simulate this game now. Your version should just print out a number, or “fizz”, “buzz”…


In this article we discuss recursion in Python programming. Recursion is a fundamental concept in Computer Science, and regardless of what your development goals are, it is good to have an understanding of at least the basics.

Topics covered:

  • The basic concept of recursion
  • What is a base case?
  • Some examples of recursive algorithms
  • Visualizing recursion

In terms of day-to-day development, the amount you use recursion will vary by context. Some developers may make little or no explicit use of it while for others it will be a mainstay. …


Master exam technique by learning how to get unstuck
Master exam technique by learning how to get unstuck

This article will help you to achieve your full potential in exams for any subject.

Have you ever been in an exam where you have read a question and your brain has just frozen?

You know topic you are being asked about, but you can’t begin to think how to squeeze that knowledge into the form needed for the question.

HELP — I’ve got brain freeze!

(In this article the phrase *brain freeze* is used metaphorically to refer to not being able to think effectively under pressure, rather than the painful experience of eating something too cold too fast.)

This…


HackerRank is a site where you can supercharge your Python programming skills, master data structures and algorithms, and stand out to prospective employers by solving challenges alongside programmers from all around the world. It is also used by recruiters to evaluate prospective employees’ abilities.

If you are learning Python, which is the main focus of this blog, you will find a huge amount of material to help you develop your skills. However Python is by no means the only language available. For example you can use HackerRank to practice

  • C, C++, Java, C#, Python, PHP, Ruby, Go, and Swift
  • databases/SQL

Spoiler alert. Twelve Angry Men is a great film. This article will make more sense if you have seen it, and it also contains a spoiler regarding the plot.

The classic film Twelve Angry men, directed by Sidney Lumet, gives an excellent example of the kind of situation where Edward de Bono’s thinking tools are supremely relevant. …


There is a lot that can be done with Python programming using the IDLE editor which the standard installation ships with, or a simple text editor such as Sublime Text or Notepad++. For some purposes a lightweight option such as these makes a lot of sense, and you can just get on and write some Python code with minimal setup.

However, there are many advantages which come with using a more powerful IDE (Integrated Development Environment) like PyCharm.

In this post I will share some of the features of PyCharm which I make the most use of and which make…


The ability to make sense of data is more important than ever in today’s complex world. Data is everywhere, and being able to interpret it empowers us to make effective decisions, as well as to avoid being misled when it is presented in misleading ways, whether intentionally or not.

Some of the areas where understanding of data analysis techniques is essential are:

  • Medicine
  • Business
  • Government
  • Humanitarian Aid
  • Many branches of science
  • Artificial Intelligence/Machine Learning

The Python programming language is a perfect tool for analysing and working with data. There are many powerful open source libraries available which enable us to…

Compucademy

Computer Science Education for the Next Generation. Teaching, Training and Resources.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store