How to calculate the absolute value for an array in python?
for example: a = [5,-2,-6,5]
I want to know the max of abs(a), and the answer should be 6. Thank you!
max(abs(i) for i in [5, -2, -6, 5])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With