-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDictionary exercise.py
26 lines (21 loc) · 1023 Bytes
/
Dictionary exercise.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
course_room = {"CS101": 3004, "CS102": 4501, "CS103": 6755, "NT110": 1244, "CM241": 1411}
course_instructor = {"CS101": "Haynes", "CS102": "Alvarado", "CS103": "Rich", "NT110": "Burke", "CM241":"Lee"}
course_meeting = {"CS101": "8:00 a.m.", "CS102": "9:00 a.m.", "CS103":"10:00 a.m.", "NT110": "11:00 a.m.", "CM241": "1:00 p.m."}
print()
print("Course Information")
print("-----------------------")
user_entry = input("Course code: ")
if user_entry == "CS101":
print("Room number", course_room["CS101"])
print("Instructor: ", course_instructor["CS101"])
print("Meeting time: ", course_meeting["CS101"])
elif user_entry == "CS102":
print("Room number: ", course_room["CS102"])
print("Instructor: ", course_instructor["CS102"])
print("Meeting time: ", course_meeting["CS102"])
elif user_entry == "CS103":
print("Room number: ", course_room["CS103"])
print("Instructor: ", course_instructor["CS103"])
print("Meeting time: ", course_meeting["CS103"])
else:
print("Entry not valid.")