7 lines
204 B
Python
7 lines
204 B
Python
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
|
|
|
|
# Nur gerade Zahlen (x % 2 == 0) herausfiltern
|
|
result = list(filter(lambda x: x % 2 == 0, numbers))
|
|
|
|
print("Ergebnis:", result)
|
|
assert result == [2, 4, 6, 8, 10] |