10: Logic Errors in Python

Extend it:

Find and fix common errors in your code

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

The image below was originally from AG Careers and attempts to show a variety of routes into agricultural STEM jobs.

STEM Careers ‘flowchart’ from AG Careers

The idea is that you start in the top left of the diagram and ask yourself lots of questions before finding out a job suggestion that you might want to consider.

The code below attempts to start turning the diagram above into a python program. It works through the questions on the left of the diagram and leaves the rest for you to follow the diagram.

Challenges:

 
  1. Extend the careers advice program to follow the ‘flowchart’ above

    So far the python program asks the questions you see if you follow the pathways to the left on the diagram. You need to add more input() and if statements

  2. Redraw the flowchart so that it uses the correct symbols!

    The diagram above is a pretty horrible example of a flowchat as it uses the wrong shapes. If that bugs you, use something like PowerPoint or draw.io to redraw it properly.

  3. Create your own careers advice program that recommends different jobs

    You can ask whatever questions you like and suggest whatever jobs you think most appropriate. Do some research so that you can say what salary you’d expect to earn for each job too.

There’s loads of possible ways of approaching these challenges so they only self mark in the following ways:

  • You need to use input() at least 5 times
  • You need to write at least 50 lines of code (not including blank lines)

Use your imagination and creativity alongside your logical thinking skills to see what you can create.

2 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

Leave a Reply

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