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:

What attracts you to computing

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:

11: Lists in Python

Almost every program needs to be able to store data. Variables are great for storing individual values but it’s often useful to be able to store and process lots of data in a particular order.

Store and use lots of data in the same variable
Lists in python: Store and use lots of data in the same variable

Lists let you store and use lots of data in one variable. This activity explains how to access data stored in a list; how to add and remove data; how to choose something at random from a list and how to sort a list.

Contents:

Page 1: Intro

Page 2: The theory: learn what you need to know as fast as possible.

Page 3: Try it: try out and adapt some working python code snippets.

Page 4: Debug it: Learn how to find and fix common mistakes.

Page 5: Extend it: Choose a project idea to use your newfound python skills.

K PRIDE: Tips for teaching programming so everyone can make progress

I was asked to deliver one of the National Centre for Computing Education’s bursary funded accelerator python courses at Fulford School this week and really enjoyed working with some great teachers who came along to learn and share their experiences.

I thought long and hard before the course about how to pull together all the mistakes I’ve made and the lessons I’ve learnt over the last decade of teaching Computing into some practical advice that can help make the teaching and learning of programming more accessible for learners of all abilities, interests and backgrounds.

K PRIDE is way of making the teaching and learning of programming accessible for all students that builds on the success of the PRIMM methodology.

K-PRIDE: Tips for teaching programming so everyone can make progress

I really admire Sue Sentance’s research and work on how to structure the teaching and learning of programming in a classroom environment.

Her PRIMM methodology has been really influential in making programming lessons more accessible and enjoyable. Programming can be both rewarding and creative but it’s definitely not an easy thing to learn.

There are so many mistakes we can make as teachers which can make learning to write, understand and debug programs frustrating for our students so I’m really grateful to Sue and others for addressing this and coming up with practical tips to make sure no student needs to feel left behind.

PRIMM methodology

Sue’s research shows that structuring teaching and learning using the PRIMM model can help support students who’d otherwise struggle as well as stretching students who make more rapid progress.

You can read more about PRIMM here.

I’d like to suggest that there are two additional but essential things that can build on the success of PRIMM in order to help make computing lessons more accessible and effective for helping students understand core programming concepts.

It’s hard to ready any programming resources without coming across a barrage of tier 3 (specialised) vocabulary which can act as an impenetrable barrier to students who just don’t understand either what they’ve been asked to do or how to ask for help.

The K of K PRIDE stands for keywords so that teachers are encouraged to explicitly teach key terminology so that students are empowered to talk about, understand and ask for support their programming learning journey.

Going through a glossary of key terms for a particular programming skill empowers them to be able to articulate what they want to achieve, search for how to solve the problems they’ll inevitably encounter and will help enable teachers and students to accurately discuss what their programs are actually doing at each stage of development.

Referring back to keywords and definitions after teaching programming concepts helps students identify and cope with the same terminology when they encounter it in reference, revision or assessment material.

Keywords

The PRI of K PRIDE are borrowed from PRIMM: Predict, Run and Investigate which are types of activity which gradually but actively build up students’ confidence understanding and experimenting with code.

The other new aspect of K PRIDE is D for Debugging. This is the part of learning to program which can be most infuriating for new beginners.

The temptation for teachers with limited curriculum time available is just to show students ‘how to do it right’. However, If students are only ever given code that works, they miss out on the opportunity to build up the confidence, experience and resilience they need to cope when their own code doesn’t work first time.

Debug

Deliberately creating opportunities for students to practice fixing common mistakes means that they can learn to interpret error messages independently and also provides a really valuable opportunity for discussing why certain common errors occur and how to avoid them.

Being able to find and fix errors in code can be very satisfying and a great way of remembering and understanding how code works.

The E of K PRIDE merges the Modify and Make aspect of PRIMM into Extend. I think it’s really important to give students a choice of how to apply their knowledge, skills and understanding with clearly defined but open ended challenges.

This allows students to feel a sense of ownership and pride in their work as they refer back to all of the support and scaffolding of the resources they’ve encountered so far (Keywords and definitions, Predict / Run outcome, Investigation conclusions and Debugging results) to Extend a code template or write their own related project.

Extend

It’s important that some of these activities are sufficiently challenging to stretch the most able students but it’s equally important to make sure that less confident students can choose at least one activity which they’ll also be able to find achievable.

Tips for differentiating programming challenges for less confident students:

1) Provide a small amount of code that can act as a starting point. Starting from scratch can be very intimidating until you’ve build up the necessary experience and confidence.

2) Provide a limited number of instructions (I’d recommend 3-5) as comments as part of the template code you provide. Make sure you only use specialist terminology if you’ve already covered it as one of your keywords. Ideally the challenges will be written in order of difficulty starting with the easiest.

3) Keep your examples brief and use whitespace (empty lines) to break up your code into ‘logical paragraphs’. Dyslexic students particularly find large blocks of code very difficult to process.

4) Use a suitable IDE. Many schools use IDLE because it comes bundled with most flavours of Python. I’d recommend Thonny or Mu because both show the line number next to each line of code which I think is essential for effective dialog between teacher and student. Thonny also does a great job of making suggestions on how to fix common error messages.

5) Carefully consider any assumed knowledge from other topics or subjects. Links to maths, science, geography or music can be a great way to motivate and engage some students, programming challenges that rely on those concepts can be significant barriers for other students. Equally, if your current topic is just about input and output, don’t expect students to write a program that requires a knowledge of iteration or functions/procedures unless you’ve already covered that. By all means use those cross topic / subject links to stretch some students but make sure you’ve got at least one Extend activity that is purely related to the concepts you’re trying to teach in that lesson.

For more details about each step of K PRIDE along with some example resources, download this overview and workbook:

I know how challenging it can be as a teacher to structure our programming lessons to enable every student to enjoy making progress. I don’t have all the answers but I’ve made enough mistakes to hope that this is useful. Let me know what you think and how you get on!

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.