import random
list = []
for x in range(0,10):
list.append(random.randint(1,100))
#Alternative
#list = [int(num) for num in input().split()]
print(list)
num1=0
for elem in list:
if elem%2==1: num1+=1
num2 = len(list2)-num1
print("Нечетных элементов",num1,"\nЧётных элементов",num2)
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
import random
list = []
for x in range(0,10):
list.append(random.randint(1,100))
#Alternative
#list = [int(num) for num in input().split()]
print(list)
num1=0
for elem in list:
if elem%2==1: num1+=1
num2 = len(list2)-num1
print("Нечетных элементов",num1,"\nЧётных элементов",num2)