mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-08 12:35:59 +08:00
Update absMin.py
This commit is contained in:
@ -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
|
||||||
|
Reference in New Issue
Block a user