0

The end result is the column in yellow which will be called "New Column". Starting point is just column A

enter image description here

I tried to write something but i am completely stuck and not sure how to proceed. This is my attempt:

potential logic :

current assigned value = previous assigned value + current original list

sample = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0]

def newcolumn(array):
    temp = 0
    result = []
    
    for num in range(1, len(array)-1):
        result.append(array[temp + 1] + array[temp])
        temp += 1
    return result

Bob
  • 23
  • 2

0 Answers0