# 计算序列的和 def sumlist(nums): total = 0 for n in nums: total += n return total