Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

python Function Name: courseCreator Parameters: courseList ( list) Returns: newCourse ( string ) Description: Write a function that takes in a list of courses and

python

image text in transcribed

Function Name: courseCreator Parameters: courseList ( list) Returns: newCourse ( string ) Description: Write a function that takes in a list of courses and returns a new course name. This course name should have the same department abbreviation as the courses in the course list (i.e. if the course list contains computer science courses the new course should start with "CS"). This new course's course number should be the average of all the course numbers of the courses in the course list (e.g. if the list passed in is ["CS1301", "CS1331"] the ouptut should be CS1316 ). You may assume that all the courses in the course list will be in the same department. The average of all the course numbers will always be an integer (how do we make sure this is the case?). If the empty list is passed in, the function should return None. Note: The length of the list can vary! >>> courselist = ["CS1301", "CS1331", "CS1332", "CS2316", "CS4400"] >>> print(courseCreator(courseList)) CS2136 >>> courseList = ["MATH1551", "MATH1552", "MATH1554", "MATH2551", "MATH2552"] >>> print(courseCreator(courseList)) MATH1952

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 Systems An Application Oriented Approach Complete Version

Authors: Michael Kifer, Arthur Bernstein, Richard Lewis

2nd Edition

0321268458, 978-0321268457

More Books

Students also viewed these Databases questions

Question

Question 1 (a2) What is the reaction force Dx in [N]?

Answered: 1 week ago