def test(lis): m = min(lis, key=abs) return abs(m) if -m in lis else m
get positive number from a list if there's the same number but negative
get positive number from a list if there's the same number but negative
|
|
Users browsing this thread: 1 Guest(s)