Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students also viewed these Databases questions

Question

How do Dimensional Database Models differ from Relational Models?

Answered: 1 week ago

Question

What type of processing do Relational Databases support?

Answered: 1 week ago

Question

Describe several aggregation operators.

Answered: 1 week ago