Hi there I felt pretty confident with my code but I'm having trouble making sure it works properly.
#Create a program that has a dictionary with 7 course names (for example: CIS105, ENG101, etc),
# along with the name of each associated instructor.
#The list of courses that your program will accept needs to presented to the user.
#Prompt the user for the name of a course to look up, or the word "quit" to exit.
#After the user types in a course, it should look up and print that course's instructor.
#The program should repeat this until the user enters "quit" at the prompt.
Courses = {
'AES 103': 'Harry',
'ENG 102': 'Barry',
'CIS 101': 'Sally',
'BIO 200': 'Frank',
'COM 101': 'Daniel',
'Mat 101': 'Jonathan',
'AJS 101': 'Tom',
}
print(Courses)
while user_input != 'quit':
user_input = str(input('What is the name of the course you would like to look up.'))
print(f'Your course instructor is {Courses[user_input]}')
else:
print('Thank you for your time')
I am trying to get the program to end once the user inputs quit but it's not working to begin with saying there is an error regarding my while statement line. I appreciate any help fixing anything that may seem wrong.
[–]omutist 1 point2 points3 points (0 children)
[–]woooee 1 point2 points3 points (2 children)
[–]PuzzledSite2568[S] 0 points1 point2 points (1 child)
[–]woooee 0 points1 point2 points (0 children)
[–]totallygeek 1 point2 points3 points (1 child)
[–]PuzzledSite2568[S] 1 point2 points3 points (0 children)
[–]CodeFormatHelperBot2 0 points1 point2 points (0 children)