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 Create a list called mylist with the following items: 'apple', 'banana', 'cherry', 'date', and 'elderberry'.
Task Print the third item in mylist.
Task Print the last item in mylist.
Task Using slicing, create a new list called newlist that contains the second, third, and fourth items from mylist.
Task Create a function called countvowels 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 Create a function called reverselist 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 Create a function called removeduplicates 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 Create a function called removeitems 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
