Welcome

This site is designed for teachers and students who want (or need!) to learn python programming.

This blog aims to have programming project ideas, links and resources that you can use at home or in the classroom but the main tool at the core of this site is create.withcode.uk which lets you write, run, debug and share python code on any device. Find out more here

Python Tutorials

These beginners guides let you learn the basics of python then work through interactive challenges before generating a free PDF certificate to show off your progress

01: Python: Output

This activity is designed to help you learn how to use python to write a program that displays an output. 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....

02: Python: Input

This activity is designed to help you learn how to use python to write a program that asks the user for input. 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...

03: Python: Syntax errors

This activity is designed to help you learn how to use python to write a program that asks the user for input. 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...

04: Python: Variables

This activity is designed to help you learn how to use python to write a program that uses and stores data in variables. As well as learning how to debug syntax errors, so far we've looked at how to do input and output in python. The next step is to learn how to store...

05: Python: Naming Conventions

This activity is designed to help you learn how to use python to write a program that uses and stores data in variables. So far we've looked at input, output and variables along with a healthy dollop of debugging. The next step is to learn some rules that help us keep...

06: Python: Data Types

This activity is designed to help you learn how to use python to write a program that uses and can convert between a range of different types of data. Python Data types: Convert and use different types of data The last few activities looked at how we can use variables...

07: Python: Runtime errors

This activity is designed to help you learn how to recognise and fix errors that cause your program to crash when you're writing python code. Python runtime errors: Find and fix common errors in your code The last few activities...

08: Sequence in Python

There are three main building blocks that all computer programs consist of: sequence, selection and iteration. This activity is designed to help you design and code your own sequences with python. Sequence in Python: Plan the order of instructions carefully The...

09: Selection in Python

There are three main building blocks that all computer programs consist of: sequence, selection and iteration. This activity is designed to help you understand and use selection in python programs. Selection: Tell your code how to make decisions Selection means making...

10: Logic Errors in Python

There are three types of errors that you'll come across when learning to program in python (or any language): syntax errors, runtime errors and logic errors. Logic errors in python: Find and fix common errors in your code Logic errors are often the hardest to...

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. Lists in python: Store and use lots of data in the same variable Lists let...

12: Iteration in Python

One of the most powerful things that makes computer programs so useful is their ability to repeat tasks quickly and efficiently. Iteration means controlling how many times a section of code will repeat. Iteration in Python: Make code repeat as many times as you want...

13: Writing data to a file in python

The power of python for processing data becomes even more useful when you can save the output from your program to a file. Writing data to a file in python Contents: Page 1: IntroPage 2: The theory: learn what you need to know as fast as possible.Page 3: Try it: try...

14: Reading data from a file in python

Being able to read and process data from a file is a very useful skill that can save hours of time by allowing you to automate repetitive tasks very quickly. Reading data from a file in python Contents: Page 1: IntroPage 2: The theory: learn what you need to know as...

15: Error handling in python

Just because code works once doesn't mean that it's always going to work. Being able to write code that doesn't crash or behave unexpectedly when things go wrong is a really useful skill. This tutorial guides you through how to use exception handling to control how...

16: Procedures in python

Making and using your own procedures in python is a great way to make your code more efficient, more readable and more re-usable. This tutorial guides you through what a procedure is, how to use them and how and when you should define your own procedures. Procedures...

17: Functions in python

Functions are just like procedures but with one key difference that makes them even more useful. This tutorial guides you through what a function is, how to use them and how and when you should define your own functions....

18: Parameters in python

Functions and procedures are both examples of sub programs. They both allow you to re-use code to make your programs more efficient and easier to read. Parameters allow you to customise how procedures or functions work to make them even more powerful and flexible....

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...

The importance of comments in Python

Comments are sections of code that are ignored by python when your code runs. But they are still really useful for making your code easier to read, understand, debug and improve. This tutorial explains 5 ways that comments can help you as you learn to code in python....

Recent posts:

New season of live.withcode.uk: free python resources for GCSE Computer Science

Well done to all the students (and teachers!) who worked so hard to prepare for the first ever on-screen practical python exam as part of the reformed Edexcel GCSE in Computer Science. Live.withcode.uk was launched in 2020 to provide free practical python activities...

How do computers work? Part 3: Supplying the power

This is the third post in a series that aims to document the process of building a Gigatron retro gaming computer which uses logic chips instead of an existing microcontroller in order to explore what each part of a general purpose computer does and how it works. You...

How do computers work? Part 2: Capacitors

This is the second post in a series that aims to document the process of building a Gigatron retro gaming computer which uses logic chips instead of an existing microcontroller in order to explore what each part of a general purpose computer does and how it works. You...

How do computers work? Part 1: Introduction

I teach computing to some brilliant students aged 11-18 in York, UK and one of my favourite parts of my job is when my students ask the "how" and "why" questions that connect the dots between the different topics and subjects that we learn in school. This is the first...