Сумма массива на питоне до индекса

def sum_up_to_index(lst, index):     
  return sum(lst[:index]) 
Powerful Penguin