Advertisement
k1alo

Четные числа в списке

Oct 27th, 2023
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.17 KB | None | 0 0
  1. my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
  2. even_numbers = []
  3. for number in my_list:
  4.     if number % 2 == 0:
  5.         even_numbers.append(number)
  6. print(even_numbers)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement