import random
a = []
for i in range(10):
a.append(random.randint(-20, 15))
for k in a:
if abs(k%10) == 0:
zero_endin.append(k)
if zero_endin:
print(sum(zero_endin)/len(zero_endin))
else: print(0)
mult = 1
for _ in range(10):
if _%2 == 0:
mult *= a[_]
print(mult)
Объяснение:
import random
a = []
for i in range(10):
a.append(random.randint(-20, 15))
for k in a:
if abs(k%10) == 0:
zero_endin.append(k)
if zero_endin:
print(sum(zero_endin)/len(zero_endin))
else: print(0)
mult = 1
for _ in range(10):
if _%2 == 0:
mult *= a[_]
print(mult)
Объяснение: