I've tried to create a generator function which can find simple moving average of the list, but it doesn't work at all. I think the root of the problem might be in finding sum
def gen(lst, n):
s = 0
for i, _ in enumerate(lst):
if lst[i] < n:
s += lst[n - (n-i)]
my code does nothing when i play it. What should I do?