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.

Find and fix common errors in your code
Python runtime errors: Find and fix common errors in your code

The last few activities looked at how we can use variables and constants to store data and how to convert data between different data types.

There’s a good chance that you’ve come across some error messages whilst trying, debugging and extending your python code.

As mentioned before, there are three types of errors you’ll need to be able to find and fix: syntax errors, logical errors and runtime errors.

This activity focuses on runtime errors: what they are, how you can avoid them and how you can fix them.

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.

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.

Convert and use 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 and constants to store data so that we can process it and display it when the code runs.

All the examples we’ve looked at so far have used text data rather than numbers.

The next step is to learn how to write code that deals with both numbers and text, converting between and combining the two wherever necessary.

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.

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.

Use variables and constants with sensible names
Python naming conventions: Use variables and constants with sensible names

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 our code easy to read, debug and share so that others can understand it too.

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.