[BangPypers] List compression imrpovement
vnbang2003 at yahoo.com
Wed Jan 9 10:14:46 CET 2013
Yes problem statement is correct.
I wanted it to be one line solution so i used list compression.
If there is other way to do it in one line other then list compression that should be fine , but need one line answer for this.
From: Jeffrey Jose <jeffjosejeff at gmail.com>
To: Bangalore Python Users Group - India <bangpypers at python.org>
Sent: Wednesday, 9 January 2013 1:31 PM
Subject: Re: [BangPypers] List compression imrpovement
Let me guess. You want the first tuple with elements that are divisible by
2 and second divisible by 3. Beats me still as to why you decided to call
From your second email it seems like you're after list *comprehension*.
On Wed, Jan 9, 2013 at 1:20 PM, Gora Mohanty <gora at mimirtech.com> wrote:
> On 9 January 2013 13:11, vijay <vnbang2003 at yahoo.com> wrote:
> > Hi,
> > I want to know if there is any other better way for improving below
> list compression. I have to use list compression only to achieve it.
> > say i have list a=[1, 4, 9, 12, 15, 21] expected result (4, 12),
> (9, 12, 15, 21)
> It would help if you defined what you mean by "list compression"
> in this case. It is not immediately obvious what you are trying to
> BangPypers mailing list
> BangPypers at python.org
BangPypers mailing list
BangPypers at python.org
More information about the BangPypers