mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-03-20 05:29:48 +00:00
Update absMin.py
This commit is contained in:
parent
aa11f16a42
commit
70a6d98e0f
@ -6,7 +6,7 @@ def absMin(x):
|
|||||||
>>absMin([3,-10,-2])
|
>>absMin([3,-10,-2])
|
||||||
-2
|
-2
|
||||||
"""
|
"""
|
||||||
j = x[0]
|
j = absVal(x[0])
|
||||||
for i in x:
|
for i in x:
|
||||||
if absVal(i) < j:
|
if absVal(i) < j:
|
||||||
j = i
|
j = i
|
||||||
|
Loading…
x
Reference in New Issue
Block a user