I'm not sure if I understand the task correctly, but here is my solution in Python:

def function(lst):

new_lst = []

for i in range(len(lst)-6):

new_lst.append(sum(lst[i:i+6]))

return new_lst

Or you can use map and it looks like this:

def function2(lst):

new_lst = list(map(sum, [lst[i:i+6] for i in range(len(lst)-6)]))

return new_lst

Hope this helps