Thanks for you help, but I figured it out without setting the variables. I forgot it was the sum of the first n numbers.
def sum_first_n_nums(lst, n): if n <= len(lst): return sum(lst[0:n]) elif n > len(lst): return sum(lst)