Page 1 of 1

Maximum and Minimum array

Posted: Wed Sep 12, 2018 4:55 pm
by M.fathy
has anyone neat way to get Maximum and Minimum of array :) :) :)

Re: Maximum and Minimum array

Posted: Wed Sep 12, 2018 4:58 pm
by pythoncoder
This is really a generic Python query rather than anything related to MicroPython. But here goes anyway ;)

Code: Select all

>>> from array import array
>>> a = array('i', range(10))
>>> a
array('i', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
>>> max(a)
9
>>> min(a)
0
>>> 

Re: Maximum and Minimum array

Posted: Wed Sep 12, 2018 6:51 pm
by M.fathy
thanks Mr.peter i didn't figure it same python numpy module