filter list with python

50

filter list with python -

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

print(list(filtered))

# Output:
[70, 80, 90]

python filter data from list -

filtered_numbers = [number for number in numbers if number < 3]

Comments

Submit
0 Comments