Python Forum

Full Version: Startiing a Course/Subject System with inquiry
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a project in our class which is to create a solution to real world problems and I was tasked to create a program that has a partial ordering system of courses. for example; CMSC11--->CMSC21--->CMSC123
\__>CMSC12--->CMSC13

CMSC130--->CMSC133--->CMSC140
CMSC129__/ \__>CMSC150

and then afterwards,create an inquiry program that shows all the prerequisites of the course entered by the user.
I am fairly new to python so pls pardon my noobness
What have you tried? We're not big on writing code for people here, but we would be happy to help you fix your code when you run into problems. When you do run into problems, please post your code in Python tags, and clearly explain the problem you are having, including the full text of any errors.

Note that this is what is technically called a graph, with the courses as nodes and the prerequisite relationships as edges. This can be represented in a dictionary, with the course IDs as keys and a list of course they link to (or courses that link to them) as the values. And of course, a big part of the question is how are you given the data on the course prerequisites?