[Tutor] Selecting from list

Hs Hs ilhs_hs at yahoo.com
Thu Jul 18 19:27:45 CEST 2013


hi list:

In the following list, is there a simply way to find element less than 200 sandwiched between two numbers greater than 1000.

a = [3389, 178, 2674, 2586, 13731, 3189, 785, 1038, 25956, 33551]


in a, 178 is between 3389 and 2674.  How this particular list can be selected for further processing. 
(sorry this is not homework question. I want to avoid looping, because I have 300K lines to parse through)

Thanks
Hs.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130718/d0e351c7/attachment.html>


More information about the Tutor mailing list