Python中可以使用內置函數`sum()`對數組求和。該函數接受一個可迭代對象作為參數,并返回其元素的和。示例:```pythonarr = [1, 2, 3, 4, 5]total = sum(arr)print(total) # 輸出:15```