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

python

python Function Name: courseCreator Parameters: courseList ( list) Returns: newCourse ( string

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

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!