场景模拟: 序列元素在原有基础上加1 常规方法 简单但扩展性查 num1 = [1,2,3,4,5,6,7,8,9,100] res = 0 for i in num1: res += i print(res) 函数方法 扩展性好,代码多 num1 = [1,2,3,4,5,6,7,8,9,100] def reduce_test(array): res = 0 for i in array: res += i return res print(reduce_test(num1)) reduce…