Answers for "how to use a filter to make a list"

9

filter list with python

scores = [70, 60, 80, 90, 50]
filtered = filter(lambda score: score >= 70, scores)

print(list(filtered))

# Output:
[70, 80, 90]
Posted by: Guest on January-12-2021

Code answers related to "how to use a filter to make a list"

Python Answers by Framework

Browse Popular Code Answers by Language