s = []
sum = 0
for i in range(10):
s.append(int(input())) # Если цены с плавающей точкой, то float()
sum += s[i]
print(s[i],end=" ")
print()
print("Сумма:",sum)
import random
d = []
f = []
for i in range(15):
d.append(random.randint(0,100))
print("Массив D:", d)
for i in d:
if i < 45 and i > 15:
f.append(i)
print("Массив F:", f)
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
3.
s = []
sum = 0
for i in range(10):
s.append(int(input())) # Если цены с плавающей точкой, то float()
sum += s[i]
for i in range(10):
print(s[i],end=" ")
print()
print("Сумма:",sum)
4.
import random
d = []
f = []
for i in range(15):
d.append(random.randint(0,100))
print("Массив D:", d)
for i in d:
if i < 45 and i > 15:
f.append(i)
print("Массив F:", f)