Reference no: EM132356301
Question
Write down the start time, room, and instructor for each class In Python create three dictionaries, times, rooms, and instructors. Each will have the class IDs as key and the appropriate values. In a loop, show a user a list of the IDs and ask them to enter one or XXX100 to exit the loop and program. If they don't enter any of the IDs or XXX100, display an error and ask them again. When they enter a valid ID (use the variable name course), display the time, room, and instructor like this:
print('The details for course', course, 'are:')
print('Room:', rooms[course])
print('Instructor:', instructors[course])
print('Time:', times[course])
stuck and cant get nothing but errors the book for the class dosen't explain anything well, here is the code
bus139 = {
'course': 'bus139',
'rooms': ['bit 214'],
'instructors': ['A. Garfinkel'],
'times': ['Monday 11am']
}
bus153 = {
'course': 'bus153',
'rooms': ['bit 107'],
'instructors': ['L. Wheeler'],
'times': ['Monday & Wensday 6pm']
}
cts120 = {
'course': 'cts120',
'rooms': ['bit 122'],
'instructors': ['E. Busch'],
'times': ['Thursday 530pm']
}
cti289 = {
'course': 'cti289',
'rooms': ['bit 123'],
'instructors': ['A. Walker'],
'times': ['Wensday 6pm']
}
net125 = {
'course': 'net125',
'rooms': ['bit 123'],
'instructors': ['E. Busch'],
'times': ['Tuesday 930am']
}
while True:
print('Enter You're Course ID: ( Enter XXX100 to exit)')
name = input()
if name == 'XXX100':
break
if name in course:
print('The details for course', course, 'are:')
print('Room:', rooms[course])
print('Instructor:', instructors[course])
print('Time:', times[course])