PYTHON!!! Write a function that will filter course grades that are stored in a list, creating and returning a new list. Your implementation must have the following rules: - The function must accept two (and only two) parameters: The first is: the maximum integer value for any grade to remain in the list (any value above the maximum will be filtered and removed from the list). The second is: the list of grades (you can assume the list contains only integer values) - The function must return a new list and not modify the existing list.
PYTHON!!!
Write a function that will filter course grades that are stored in a list, creating and returning a new list. Your implementation must have the following rules:
- The function must accept two (and only two) parameters:
The first is: the maximum integer value for any grade to remain in the list (any value above the maximum will be filtered and removed from the list).
The second is: the list of grades (you can assume the list contains only integer values)
- The function must return a new list and not modify the existing list.
- The function must use a list comprehension to filter the existing list and create the new list that is returned.
- DO NOT USE THE: built-in-"filter" function.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images