MCPcopy Create free account
hub / github.com/subbarayudu-j/TheAlgorithms-Python / absMax

Function absMax

Maths/absMax.py:1–12  ·  view source on GitHub ↗

#>>>absMax([0,5,1,11]) 11 >>absMax([3,-10,-2]) -10

(x)

Source from the content-addressed store, hash-verified

1def absMax(x):
2 """
3 #>>>absMax([0,5,1,11])
4 11
5 >>absMax([3,-10,-2])
6 -10
7 """
8 j =x[0]
9 for i in x:
10 if abs(i) > abs(j):
11 j = i
12 return j
13
14
15def main():

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected