Question: I need to re-enter the loop after I have made an entry. My code is below. It needs to re-ask what option I need instead

I need to re-enter the loop after I have made an entry. My code is below. It needs to re-ask what option I need instead of repeating the same choice coursesList =[] courseOption = input("Enter A to add course, D to drop, or E to exit: ") courseOption = courseOption.upper() while(courseOption != 'E'): if courseOption == "A": addCourse = input ("Enter course to add:") if addCourse not in coursesList: coursesList.append(addCourse) coursesList.sort() print("Succesfully added course.") print("Registered courses:", coursesList) else: print("You are registered in that course.") elif courseOption == 'D': droppedCourse = input("Enter course to drop:") if droppedCourse in coursesList: coursesList.remove(droppedCourse) print("Course succesfully dropped.") print("Registered courses:", coursesList) else: print("You are not registered for that course.") else: print("Invalid entry.") courseOption = input("Enter A to add course, D to drop, or E to exit: ") courseOption = courseOption.upper()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!