Finding the Min for positive and negative in python 3.3 list

Norah Jones nh.jones01 at gmail.com
Tue Mar 12 13:03:08 EDT 2013


For example:
a=[-15,-30,-10,1,3,5]

I want to find a negative and a positive minimum.

example: negative
print(min(a)) = -30
 
positive
print(min(a)) = 1

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130312/677f5f23/attachment.html>


More information about the Python-list mailing list