Python Pond Quiz for Pygame Zero

Let’s use the excellent Mu editor and PygameZero library to build a simple quiz in Python. You could pick any topic – here we’re using pond life.

This tutorial is not too hard, it should be suitable for Python beginners.

Getting set up

See Mu for download links and instructions for installing Mu on your platform.

The Mu installer also installs PyGame and PyGame zero.

If you have any trouble installing Mu, as a fallback you can download PortaMu from that same page. You don’t need a pen drive as the website suggests, PortaMu will simply run anywhere without being installed. Just download and unzip on to your desktop.

It is not advised not to run the portable and the fully installed version of Mu on the same system, as they can sometimes interfere and break both installations.

Launching Mu

The first time you start Mu you might be asked which mode you want to work in. For this project you will be using PyGame Zero. If you already have Mu open in a different mode you can switch using the mode button in the top left.

A guided approach

This tutorial has been written with the young people that come to Coder Dojo Brighton .

We find it works really well if a mentor guides each person through the tutotial step by step. Anyone that knows a bit of coding can be a good mentor.

Beginners in Python are likely to have problems with:

  • Saving code in the first step to mu_code
  • Saving images to mu_code/images
  • Indenting things correctly, especially if-statements
  • Adding new code to existing functions.

When mentoring remotely we’ve found this online tool works really well for debugging: https://pad.riseup.net/ – it enables both mentor and student see and edit the code at the same time.

Get in touch

We would love to hear how you’ve got on with this tutorial or receive any other feedback. Get in touch with the author: Eric Clack <eric@bn7.net>