Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Python function school_courses which consumes data, a nonempty string containing the name of the file containing information about this term's students and the

image text in transcribed

Write a Python function school_courses which consumes data, a nonempty string containing the name of the file containing information about this term's students and the courses they are enrolled in. The function returns a new dictionary: The keys correspond to the names of the courses (all in upper case). You may assume that courses' names do not include space The corresponding value for a course is a list of all students who are enrolled in this course This list must be sorted into alphabetical order for the names of the students, based on Python's sort method The input file will have the name of a student in a line, followed by a list of courses the student is enrolled in, then a blank line, and then information about another student. For example, the provided file s18.txt follows this format. You may assume the following: .There will be information about at least one student in the consumed file. .There will be at least one course listed for each student. Two course names are the same regardless of upper and lower case differences, for example CS116, Cs116, cS116, cs116, all are considered to be the same course Calling school_courses ("s18.txt") returns {"CS115': ['Alice Dean', 'Dave Brown ', 'Mary Sue '], 'MATH 135': ['Alice Dean', Dave Brown', 'CHEM100': ['Alice Dean', 'Dave Brown', 'Mary Sue','MATH200' ['Alice Dean', 'Mary Sue')

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David M. Kroenke, David Auer

11th Edition

B003Y7CIBU, 978-0132302678

More Books

Students also viewed these Databases questions

Question

Explain the need for a critical analytical approach to studying HRM

Answered: 1 week ago

Question

What are the main objectives of Inventory ?

Answered: 1 week ago

Question

Explain the various inventory management techniques in detail.

Answered: 1 week ago

Question

3. Evaluate a Web-based training site.

Answered: 1 week ago