Question: Task 1 Create a list called my _ list with the following items: 'apple', 'banana', 'cherry', 'date', and 'elderberry'. Task 2 Print the third item

Task 1 Create a list called my_list with the following items: 'apple', 'banana', 'cherry', 'date', and 'elderberry'.
Task 2 Print the third item in my_list.
Task 3 Print the last item in my_list.
Task 4 Using slicing, create a new list called new_list that contains the second, third, and fourth items from my_list.
Task 5 Create a function called count_vowels that takes a list of words as an argument and returns the total number of vowels in all the words in the list. Assume that the input list only contains strings.
Task 6 Create a function called reverse_list that takes a list as an argument and returns a new list with the items in reverse order. Do not modify the original list.
Task 7 Create a function called remove_duplicates that takes a list as an argument and returns a new list with the duplicates removed. The items in the new list should be in the same order as the original list.
Task 8 Create a function called remove_items that takes two lists as arguments and returns a new list that contains the items from the first list that are not in the second list. The items in the new list should be in the same order as the original list.

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!