19: Optimisation in python

Python is a very powerful and flexible programming language which lets you write programs quickly, but code written in python doesn’t always run as quickly as it might in other languages (like C or C++)

This tutorial guides you through why it can be really helpful to optimise your code and how to do that.

Make your code more efficient
Optimisation in python: Make your code more efficient

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.

Free weekly python remote learning resources: update on new features

I’ve seen some really creative teaching and learning ideas to support students learning python programming during remote learning. Lots of teachers are looking for ways to stretch and support computing students while they’re working from home or as an optional extra competition during term time.

It’s been a little while since I posted an update on live.withcode.uk and I’ve been working hard on some new features:

Each week there’s a new episode of live.withcode.uk. Each episode starts with a YouTube video that talks you through the design and development of a short python program. It then has links to four interactive resources that relate to the code in the video.

You can access the resources on almost any device without needing to register or sign in at live.withcode.uk, or schools can register for free accounts so that students can compete against their classmates and teachers can track their progress.

You can watch a quick guide here:

All resources and instructions for setting up groups for students can be found at live.withcode.uk

I’ve just been working on improving the student competitions so that students can use their Microsoft Teams logins to access the challenges and scoreboards. My next challenge is to improve the user interface in create.withcode.uk to make it easier to monitor students’ code in real time.

If you have any feedback or suggestions I’d love to hear from you.

All the best!

Free weekly python remote learning activities

When the first lockdown started in March 2020 I wanted my Computing students to still be able to get some regular practice building up their skills and confidence with python programming, so I launched a series of weekly challenges that they could work through.

I took a break over the Summer but found that even with schools open for face to face teaching, I still wanted students to be able to compete against each other for prizes and grow in confidence with python programming. So in November I relaunched the live.withcode.uk weekly activities.

The challenges are aimed at my awesome Y10 Computer Science students but anyone from Y7 – Y11 who’s interested in python programming could use them. The idea is that each week there are 5 free activities that you can dip into:

  1. Live coding video on YouTube: students can watch a short (around 10 mins) video showing how a python program comes together. There’s some great research that shows live coding (inviting students into the thought processes as they see a program evolve from start to finish) can really help understanding and writing their own code.
  2. Code type race: students of any ability can type out the code from the video to grow in speed and accuracy so that programming becomes a less frustrating experience for them.
  3. Experimenting with code: students can view, edit, run and extend the code from the video on any device. The code itself has comments with challenges that students can work through.
  4. KPRIDE (Keywords, Predict, Run, Investigate, Debug, Extend): Dr Sue Sentance published some ground breaking research on a structured approach to teaching programming and KPRIDE builds on her PRIMM model with interactive activities that add an extra emphasis on code comprehension and debugging.
  5. Extension challenge: each week there’s a different game, puzzle or activity to work through that links to the code in the video

You can find all the resources here: live.withcode.uk

There are loads of great resources out there. I’m not claiming that mine are the best (by any stretch of the imagination!). But they’re free and I hope they’re helpful.

All the best and do get in touch if you have any feedback or suggestions.