Answered step by step
Verified Expert Solution
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
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)) MATH1952Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started