from random import randint
a = [randint(1,10) for _ in range(10)]
ch=nch=0
print(a)
for i in a:
if i % 2 == 0:
ch += i
else:
nch += i
print( Разность=,ch-nch)
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
from random import randint
a = [randint(1,10) for _ in range(10)]
ch=nch=0
print(a)
for i in a:
if i % 2 == 0:
ch += i
else:
nch += i
print( Разность=,ch-nch)
ch=nch=0