conditional array sum pyton code example Example: sum with conditional python sum(i for i in array if array.index(i) % 2 == 0)