Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #41139 > unrolled thread

Re: Finding the Min for positive and negative in python 3.3 list

Started byJean-Michel Pichavant <jeanmichel@sequans.com>
First post2013-03-12 18:45 +0100
Last post2013-03-12 18:45 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  Re: Finding the Min for positive and negative in python 3.3 list Jean-Michel Pichavant <jeanmichel@sequans.com> - 2013-03-12 18:45 +0100

#41139 — Re: Finding the Min for positive and negative in python 3.3 list

FromJean-Michel Pichavant <jeanmichel@sequans.com>
Date2013-03-12 18:45 +0100
SubjectRe: Finding the Min for positive and negative in python 3.3 list
Message-ID<mailman.3241.1363110303.2939.python-list@python.org>
----- Original Message ----- 

> 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
> --
> http://mail.python.org/mailman/listinfo/python-list

min(a)

and

min([e for e in a if e >=0]

Cheers,

JM


-- IMPORTANT NOTICE: 

The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web