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.

3 thoughts on “07: Python: Runtime errors

  • Pingback: Python for beginners: free interactive self marking activities

  • October 27, 2018 at 8:39 pm
    Permalink

    For some reason when I save my code it doesn’t give me a new url to use, do you know why this is?

    Reply
    • October 27, 2018 at 9:02 pm
      Permalink

      Hi Lucas. Sorry it’s not giving you a new url.
      When you change the code in one of these tracked activities it will automatically save your changes just on your computer in a cookie so that if you refresh your page you don’t have to start all over again. If you want a new URL you’ll have to press Ctrl+S. You may have to tick the ‘I’m not a robot’ box if that comes up on screen. This is irritating but it limits people exploiting the fact that anyone can save without having to log in. If you’re still having problems, reply here and I’ll email you.

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *