gervaz ger...@gmail.com writes:
Hi all, I would like to ask you how I can use the more efficient join
operation in a code like this:
class Test:
... def __init__(self, v1, v2):
... self.v1 = v1
... self.v2 = v2
...
def prg(l):
... txt =
... for x in l:
Hello,
On Sun, Jan 02, 2011 at 10:11:50AM -0800, Alex
Willmer wrote:
def prg3(l):
return '\n'.join([str(x) for x in l if x])
just one fix (one fix one fix one fix):
return '\n'.join([str(x) for x in l if x is not None])
--
With best regards,
xrgtn
--
On Mon, Jan 3, 2011 at 3:07 AM, gervaz ger...@gmail.com wrote:
On 2 Gen, 19:14, Emile van Sebille em...@fenx.com wrote:
snip
class Test:
def __init__(self, v1, v2):
self.v1 = v1
self.v2 = v2
t1 = Test(hello, None)
t2 = Test(None, ciao)
t3 = Test(salut, hallo)
On 31 Dic 2010, 16:43, Emile van Sebille em...@fenx.com wrote:
On 12/31/2010 7:22 AM gervaz said...
Hi all, I would like to ask you how I can use the more efficient join
operation in a code like this:
class Test:
... def __init__(self, v1, v2):
... self.v1 = v1
...
On 1/2/2011 9:43 AM gervaz said...
On 31 Dic 2010, 16:43, Emile van Sebilleem...@fenx.com wrote:
On 12/31/2010 7:22 AM gervaz said...
Hi all, I would like to ask you how I can use the more efficient join
operation in a code like this:
class Test:
... def __init__(self, v1, v2):
On Sunday, January 2, 2011 5:43:38 PM UTC, gervaz wrote:
Sorry, but it does not work
def prg3(l):
... return \n.join([x for x in l if x])
...
prg3(t)
Traceback (most recent call last):
File stdin, line 1, in module
File stdin, line 2, in prg3
TypeError: sequence item 0:
On 2 Gen, 19:14, Emile van Sebille em...@fenx.com wrote:
On 1/2/2011 9:43 AM gervaz said...
On 31 Dic 2010, 16:43, Emile van Sebilleem...@fenx.com wrote:
On 12/31/2010 7:22 AM gervaz said...
Hi all, I would like to ask you how I can use the more efficient join
operation in a code
On 2 Gen, 22:37, gervaz ger...@gmail.com wrote:
On 2 Gen, 19:14, Emile van Sebille em...@fenx.com wrote:
On 1/2/2011 9:43 AM gervaz said...
On 31 Dic 2010, 16:43, Emile van Sebilleem...@fenx.com wrote:
On 12/31/2010 7:22 AM gervaz said...
Hi all, I would like to ask you how I
Hi all, I would like to ask you how I can use the more efficient join
operation in a code like this:
class Test:
... def __init__(self, v1, v2):
... self.v1 = v1
... self.v2 = v2
...
def prg(l):
... txt =
... for x in l:
... if x.v1 is not None:
...
On 12/31/2010 7:22 AM gervaz said...
Hi all, I would like to ask you how I can use the more efficient join
operation in a code like this:
class Test:
... def __init__(self, v1, v2):
... self.v1 = v1
... self.v2 = v2
...
def prg(l):
... txt =
... for x in l:
...
10 matches
Mail list logo