Ответ:
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
even = []
odd = []
for number in numbers:
if number % 2 == 0:
even.append(number)
else:
odd.append(number)
print("Четные числа:", even)
print("НЕ Четные числа:", odd)
try:
numbers.remove(0)
except ValueError:
print("0 не в списке.")
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
even = []
odd = []
for number in numbers:
if number % 2 == 0:
even.append(number)
else:
odd.append(number)
print("Четные числа:", even)
print("НЕ Четные числа:", odd)
try:
numbers.remove(0)
except ValueError:
print("0 не в списке.")