You are given a list of courses that are currently available in BRACU that looks like the following: courses = ['CSE110','CSE111','MAT620','CS520','EEE361','CSE650','MAT5100','CSEE21','MAT3210']. All course code will have 3 digits with the department name of 3 letters. Any course code not following this rule is Invalid. Write a python program that creates a dictionary from the above list where the keys will be each department name (CSE,EEE,MAT for the above example) or Invalid. Departments will contain a list of valid courses for that department. Sample Input - No need to take input ['CSE110','CSE111','MAT620','CS520','EEE361','CSE650','MAT5100','CSEE21','MAT3210'] Sample Output : (You just need to print the resultatnt dictionary. No need to follow the format.) { 'CSE': ['CSE110','CSE111','CSE650'], 'EEE': ['EEE361'], 'MAT': ['MAT620'], 'Invalid': ['CS520','CSEE21','MAT5100','MAT3210'] }

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter4: The Selection Structure
Section: Chapter Questions
Problem 8E
icon
Related questions
Question

You are given a list of courses that are currently available in BRACU that looks like the following: courses = ['CSE110','CSE111','MAT620','CS520','EEE361','CSE650','MAT5100','CSEE21','MAT3210']. All course code will have 3 digits with the department name of 3 letters. Any course code not following this rule is Invalid. Write a python program that creates a dictionary from the above list where the keys will be each department name (CSE,EEE,MAT for the above example) or Invalid. Departments will contain a list of valid courses for that department. Sample Input - No need to take input ['CSE110','CSE111','MAT620','CS520','EEE361','CSE650','MAT5100','CSEE21','MAT3210'] Sample Output : (You just need to print the resultatnt dictionary. No need to follow the format.) { 'CSE': ['CSE110','CSE111','CSE650'], 'EEE': ['EEE361'], 'MAT': ['MAT620'], 'Invalid': ['CS520','CSEE21','MAT5100','MAT3210'] }

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Linux
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning