Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- numbers = list(map(int, input().split(' ')))
- def even_num():
- filtered = []
- for i in range(0, len(numbers)):
- if numbers[i] % 2 == 0:
- filtered.append(numbers[i])
- return filtered
- print(even_num())
- Решение с ламбда:
- numbers = list(map(int, input().split(' ')))
- def even_num():
- return list(filter(lambda x: x % 2 == 0, numbers))
- print(even_num())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement