Finding the Min for positive and negative in python 3.3 list

Norah Jones nh.jones01 at gmail.com
Tue Mar 12 18:03:08 CET 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