Free interactive Python tutorials for beginners

Try it, debug it, extend it
Try it, debug it, extend it: Python tutorials

Over the next few weeks I’ll hopefully be publishing a series of 20 free interactive python tutorials for beginners.

Here’s the link to the list of resources

Each activity has four sections:

Theory: what you need to know if you’re in a hurry

Try it: working code snippets that you can adapt and use

Debug it: code sabotaged with common mistakes that you can practise fixing

Extend it: open ended project ideas for your to apply what you’ve learnt.

You can track your progress through each activity and generate a free PDF certificate showing your score at the end.

The first activity is all about getting your python program to output to the screen:

Making computing accessible for all

Making computing accessible for all

This series of posts aims is aimed at UK secondary school teachers to give some free ideas and resources in order to help make computing lessons engaging and inclusive in order to help attract more and more students to continue with the subject at GCSE and beyond.

When students are choosing their GCSE options they seem to love asking teachers why we chose to teach our subjects.

Often, I can almost see the cogs turning inside some of my students’ heads, weighing up whether they should choose Computing over Art; ticking off the benefits of each subject as they make the first real choice that might affect the rest of their lives.

Whatever they use to make up their mind – who teaches the subject / what their friends are choosing / what they’re good at / what they enjoy – there’s clearly a lot more that we can do to promote Computer Science as a viable, challenging, enjoyable and worthwhile option. The national figures show a pretty poor GCSE uptake of GCSE Computer Science compared to other eBacc subjects and an abysmal uptake by girls. Boys, whilst outnumbering girls at KS4 and beyond, are being outperformed by girls from KS2 onwards. So there’s definitely something not right there that needs addressing.

CAS include
CAS #include. Making computing accessible for all

I’ve been slowly working through the brilliant advice on the CAS #include site about how to ensure that my Computing lessons aren’t just catering for people like me and it strikes me that the way to be inclusive for all also looks and sounds like the way to be engaging and stretching for all. This post aims to share some of the mistakes I’ve made as well as some of the things I’m trying to put right to make sure that all students get the most out of their computing lessons, hopefully also boosting recruitment at KS4 too.

I’ve come up with 6 Cs to use as a checklist for planning engaging and inclusive computing projects:

Create games with python: online PyGameZero simulator

I’ve been really impressed with @lordmauve’s PyGameZero module that makes it fun and easy to create games with Python.

This post contains three example python games that you can edit and play online as a showcase of growing PyGameZero support for create.withcode.uk.

Create games with python: Flappy Bird with PyGameZero
Flappy Bird made with PyGameZero

Many students love creating and playing games and most of them have made some really creative animations and projects using Scratch’s graphical programming tools.

One of the big challenges for students is to make the transition from graphical block based programming to text based programming.

It’s harder to make mistakes with blocks but it can also be frustratingly slow if you want to make more advanced projects.

One thing that really helps is creating visual projects rather than just messing with text and numbers, although this often adds extra layers of complexity and confusion.

PyGame allows you to create games with python but can be intimidating for beginners

PyGame is a really powerful python module for creating games but it’s not ideal for beginner programmers as there are all sorts of things you have to understand and write before you can get anything worthwhile up and running.

PyGameZero keeps the fun and features of PyGame but makes it much simpler for beginners

PyGameZero is a fabulous module which is an abstraction of PyGame to make it simpler to create games and animations with code.

Abstraction means removing necessary detail in order to focus on the most important things.

PyGame is very powerful and feature rich but complex to use. PyGameZero is a simplified version that is ideal for creating working games with minimal code

I’ve been working through some of the great PyGameZero examples online and thought it’d be really good if students could try the code out online without having to download anything.

So, I’m working on PyGameZero support for create.withcode.uk so that students and teachers can write, run, debug and share python games online on any device.

It’s a work in progress, which means that there are some features that don’t quite work as they should yet but it’s at the stage where it works enough for you to be able to create games with python on chromebooks / laptops / desktops / tablets.

The next page has a python Space Invaders game that you can adapt and run in your browser.

Online python tkinter simulator: 3 games to help you create python GUIs

I made create.withcode.uk to let teachers and students write, run, debug and share python code online a few years ago in order to try to make it easier for students to experiment with code on any device.

Because create.withcode.uk runs python code in your web browser, you don’t need to install any software or download the code before you run it. You just press Ctrl + Enter to run the whole code, or Ctrl + Space to run it line by line.

This makes it much easier to try out code, tweak it and share it as you’re learning, but it’s only a simulation Python: it doesn’t contain all of the features of Python 3 running offline.

One feature that teachers and students have often requested is Tkinter support.

Tkinter is the GUI (Graphical User Interface) module that comes bundled with python. It lets you create programs that have buttons, text boxes and windows rather than just a text console.

I’m in the process of adding some Tkinter support for create.withcode.uk. It’s a work in progress but I’ve implemented enough for you to get some simple GUI programs working.

There are some great website for running python code online such as trinket.io and repl.it. As far as I know, create.withcode.uk is the only one to have an online python tkinter simulator so that you can test out code to build GUIs in your browser.

Here are some of the programs I’ve been using to test out python tkinter GUI support on create.withcode.uk:

Snake game: Online python tkinter simulator
Game 1: Snake in python tkinter
Bounce game: Online python tkinter simulator
Game 2: Bounce in tkinter
Colour Quiz: Online python tkinter simulator
Game 3: Colour Quiz in tkinter

Note:

These games are examples I’m using to test tkinter support on create.withcode.uk. I didn’t write them: the original authors are credited for each game in the source code and description. Please get in touch if you created these and want me to change the way I’ve attributed your work.

Tkinter isn’t really designed for making games – it’s useful for simple GUIs but there are better python modules out there for creating games (such as pygame). You can find some great books and resources here if you’re interested: https://inventwithpython.com/

Tkinter is a huge module so there’s no way I can simulate it all accurately in a web browser but if you have some code that works offline in ‘proper’ python that doesn’t yet work properly on create.withcode.uk, please share a link to it as a comment on this page and I can use it to help add more features and support.

Have fun!

Create.withcode.uk’s python data visualisation module now available offline

Some of the most popular resources on create.withcode.uk are the bitmap image challenges, which help students see how black and white or full colour images can be represented by 2D or 3D lists of data describing the colour of each pixel.

Data representation of images: Bitmap images
Python data visualisation of images: Bitmap images

A few people have asked if it’d be possible to have an offline version of the withcode python module that is supported by create.withcode.uk which allows you to quickly display a list of data as an image.

This could be useful for lessons or clubs where an Internet connection isn’t available or for use in other python projects.

You can now download a copy of withcode.py from https://github.com/pddring/withcode-py-offline and use it in IDLE / Mu / your favourite python IDE so that your code works in the same way as it would on create.withcode.uk