Ответ:
a = int(input('a = '))
b = int(input('b = '))
c = 0 # добуток непарних чисел
d = 0 # середнє арифметичне квадратів # сумма
for i in range(a, b):
d += i**2
if i%2 != 0:
c *= i
print(f'{c=}. Среднее = {d/(b-a)}. Сумма = {sum(a,b)}')
from math import prod
a, b = map(int, input().split())
lst_num = [i for i in range(a+1, b) if i%2!=0]
print(prod(lst_num))
lst_num = [i**2 for i in range(a+1, b)]
print(sum(lst_num)/len(lst_num))
lst = [i/(i+1) for i in range(2, 11)]
print(sum(lst))
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
a = int(input('a = '))
b = int(input('b = '))
c = 0 # добуток непарних чисел
d = 0 # середнє арифметичне квадратів # сумма
for i in range(a, b):
d += i**2
if i%2 != 0:
c *= i
print(f'{c=}. Среднее = {d/(b-a)}. Сумма = {sum(a,b)}')
Verified answer
1
from math import prod
a, b = map(int, input().split())
lst_num = [i for i in range(a+1, b) if i%2!=0]
print(prod(lst_num))
2
a, b = map(int, input().split())
lst_num = [i**2 for i in range(a+1, b)]
print(sum(lst_num)/len(lst_num))
3
lst = [i/(i+1) for i in range(2, 11)]
print(sum(lst))