Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #41139 > unrolled thread
| Started by | Jean-Michel Pichavant <jeanmichel@sequans.com> |
|---|---|
| First post | 2013-03-12 18:45 +0100 |
| Last post | 2013-03-12 18:45 +0100 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
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
| From | Jean-Michel Pichavant <jeanmichel@sequans.com> |
|---|---|
| Date | 2013-03-12 18:45 +0100 |
| Subject | Re: 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.
Back to top | Article view | comp.lang.python
csiph-web