如何在python中计算数组的绝对值?
例如:a = [5,-2,-6,5]
我想知道abs(a)的最大值,答案应该是6.谢谢!
python
def CostFunction(A): return sum(A) A = [[1,1,1],[2,2,2]] print CostFunction(A[0:])
答案应该是3,但应该有一些问题A.
3
A
python python-2.7
python ×2
python-2.7 ×1