Question
You have three text files with the following information: (popu late the three files with your data. You may assume that all course numbers (keys)
You have three text files with
the following information: (popu
late the three files with your
data. You may assume that all
course numbers (keys) are included in each file.)
?
courseinstructor.txt: each line
contains the course number (ke
y) and the instructors last
name that teach each course.
The values are separated by comma.
?
courseroom.txt: each line contai
ns the course number (key) and
the room number, whe
re the course meet. The
values are separated by comma.
?
coursetimes.txt: each line contai
ns the course number (key) an
d the meeting time of each course. The values are
separated by comma.
Write a python program to c
omplete the following tasks:
?
read the content of each file
and create a dictionary for each
of the key-value pairs in a
file: {course, instructor},
{course, room} and {c
ourse, time}. You need to use a function t
hat will get the filename as input parameter, and return
the dictionary.
?
display on the screen, in a t
abular form, the course number, i
nstructor, room num
ber and meeting time.
Sample Example:
Assume that the content of the thr
ee files are as below. Note t
hat there may be more or less data in the files.
Courseinstructors.txt courseroom.txt
coursetimes.txt
The program output should be as below.
CS101,
Haynes
CS102,
Alvarado
CS103,
Rich
NT110,
Burke
CM241,
Lee
CS102,
4501
CS103,
6755
NT110,
1244
CM241,
1411
CS101,
3004
CS103,
10:00am
NT110,
11:00am
CM241,
11:00pm
CS101,
8:00am
CS102,
9:00am
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started