~ Solve Problems and Learn how to code in Python


8a - Use Dictionaries to create a mini program: Course and teacher finder

Challenge - use dictionaries to store teachers and corresponding courses in a dictionary. The program searches for a course and returns a teacher

First, watch the demo video below. Your task is to code something like this, and use the code below to get started

You can either edit and code online in repl.it or you can simply cut and paste the below into your own python file

#TASK: Create a course-teacher program
#---1-create a dictionary called "teachers_courses" that stores the names of three teachers and three courses
#---2-go straight to a login screen, where a user is asked: "What course are you doing?"
#---3 -the program responds by telling them which wonderful teacher they will have for that particular course

#EXTENSION (that everyone should be able to do!): Create a main menu which allows a user to select STUDENT or TEACHER
#if STUDENT _ go to the login screen (as above, where they are asked for a course name, and a teacher is returned)
#ifTEACHER  _go to a teacher screen where additional courses and teachers can be added to the program

teachers_courses={}

def main():
   checkcourse()

def checkcourse():
   print("*****STUDENT -Find out what teacher you will have this year******")

   

main()

Code your solution here

Systems Life Cycle (in a nutshell): Analyse - Design - Create - Test - Evaluate. Designing something or writing out some pseudocode before you actually write code is always a good idea! Get in to the habit of doing so! You can draw your flowchart here and screenshot it.

A sample flow chart (design) for this particular challenge could look like:

Flowchart: Python program to get the Fibonacci series between 0 to 50
Each challenge section below provides an online drawing tool where you can dynamically create flowcharts. Screenshot them into your presentation for submission.

Solutions & Answers

Answers /Solutions in the "members area" drive under: "Solve and Learn >>SOLUTIONS"

Testing Table

You may want to read a little about Testing first. A teacher may go through some examples with you. Feel free to fill in the test table here, and screenshot it in to your powerpoint. Testing is absolutely essential once you have created a program!
Test No. Description Test Data(input) Expected Outcome Actual Outcome Further Action?
1
2
3
4
5
Coming soon!