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.

Find and fix common errors in your code
Logic errors in python: Find and fix common errors in your code

Logic errors are often the hardest to find and fix so the aim of this activity is to help you recognize them, debug them and avoid making them wherever possible.

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.

4 thoughts on “10: Logic Errors in Python

  • February 26, 2019 at 10:33 am
    Permalink

    Shocking website!! I could not get the output without changing the browser which is not what a website should do!

    Reply
    • February 26, 2019 at 11:38 am
      Permalink

      Shocking feedback!! Please could you let me know what browser you were using and what problem you had so I can improve the shocking website painstakingly put together for free in my spare time. It’s a long way from perfect. Alternatives are available.

      Reply
  • March 26, 2020 at 3:53 pm
    Permalink

    Hiya, great website, the pound sign(£) creates a unicode error and the code will not run. If you delete the £’s it runs fine. I have tried this in Edge and Chrome.

    Reply
    • March 26, 2020 at 8:34 pm
      Permalink

      Hello,

      Thanks so much for getting in touch and reporting that bug. It should now be fixed – all strings should support unicode characters. Sorry about that!

      All the best 🙂

      Reply

Leave a Reply to Jim Donald Cancel reply

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