Question: I'm writing a code for an assignment. I already wrote a get_course_ids portion. The course Id's are [52,15,23,34]. Can someone help me write the portion

I'm writing a code for an assignment. I already wrote a get_course_ids portion. The course Id's are [52,15,23,34]. Can someone help me write the portion called choose_course that Consumes a list of integers representing course IDs and prompts the user to enter a valid ID, and then returns an integer representing the user's chosen course ID. If the user does not enter a valid ID, the function repeatedly loops until they type in a valid ID. You will need to use the input function to get the user's choice.

The code I wrote for the get_course_ID consumes a list of Course dictionaries and returns a list of integers representing course IDs:

# 5) get_course_ids def get_course_ids(available_courses): course_ids = [] for ids in available_courses: course_ids.append(ids['id']) return course_ids print(course_ids)

Now I need the choose_course ID

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!