Maximum and Minimum array

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
M.fathy
Posts: 7
Joined: Mon Jun 18, 2018 1:09 pm

Maximum and Minimum array

Post by M.fathy » Wed Sep 12, 2018 4:55 pm

has anyone neat way to get Maximum and Minimum of array :) :) :)

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Maximum and Minimum array

Post by pythoncoder » Wed Sep 12, 2018 4:58 pm

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
>>> 
Peter Hinch
Index to my micropython libraries.

M.fathy
Posts: 7
Joined: Mon Jun 18, 2018 1:09 pm

Re: Maximum and Minimum array

Post by M.fathy » Wed Sep 12, 2018 6:51 pm

thanks Mr.peter i didn't figure it same python numpy module

Post Reply