Question: Sorting and Filtering Exercise 2 In this exercise, you will continue practicing sorting and filtering with a new list of numbers. Sort in Descending Order:

Sorting and Filtering Exercise 2
In this exercise, you will continue practicing sorting and filtering with a new list of numbers.
Sort in Descending Order:
Create a list called ages with the following values: [22,35,18,27,30,40,19,25].Sort this list in descending order and store the result in a variable called sorted_ages.
Filter Ages Below 25:
Using the sorted_ages list, filter out all the ages that are below 25 and store them in a new list called ages_below_25.
Filter Ages Between 25 and 35:
Using the sorted_ages list, filter out all the ages that are between 25 and 35(inclusive) and store them in a new list called ages_25_to_35.

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!