Question: Create a new list called majorCoursesWithTrack by making a copy of the majorCourses list. Use the copy ( ) list method. Verify that the new

Create a new list called majorCoursesWithTrack by making a copy of the
majorCourses list. Use the copy() list method. Verify that the new list was created
successfully.
25. Use the list method extend() to extend the majorCoursesWithTrack list by the
contents of the list baTrack. This is equivalent to appending the elements of the baTrack
one by one to the majorCoursesWithTrack list.
26. Verify that the majorCoursesWithTrack list contains the new course elements.
27. Verify that the majorCourses list has not been modified.
28. Use the slice notation to make a copy of the majorCourses list and assign it to a new list
sortedCourseList. Verify that the new list contains the correct values.
Hint: A slice [:] with default start and end values creates a copy of the entire list.
29. Use the list method sort() to sort the sortedCourseList by alphabetical order. Verify
that the list prints in alphabetical order.
30. Use the list method sort(reverse=True) to sort the list elements in a reverse alphabetical
order. Verify that the list prints in reverse alphabetical order.
31. Use a string method join() to create a string from the sortedCourseList. Use a comma
as a joining string. Store the generated string in a variable output and print it.
32. Check your output carefully to ensure that your output matches sample output in punctuation,
spelling, spacing, and case.
33. Go over your notebook and fix all output lines to use print(). This document uses just the
expressions alone to get their output because it takes advantage of the special formatting that
the notebook engine does in those cases. However, to turn your script into a general python
program that would run as a standalone program and not only in an interactive session, you
must have all output generated by the print() function.

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 Programming Questions!