Python don't have arrays, it have lists. Do you mean “up to a certain index"? [code]def sum_up_to_index(lst, index): return sum(lst[:index]) [/code]Or “from ...
確定! 回上一頁