[SciPy-user] help with list comprehensions

Stephen Yang scyang@nist....
Wed Aug 1 13:49:58 CDT 2007

Hello everyone,

I have a question about list comprehensions. I would like to append data 
to an existing list using a list comprehension. Unfortunately, what I 
have tried does not seem to work:

 >>> y = [5, 1, 3, 5]
 >>> x = ['a', 'b']
 >>> new = [x.append(data) for data in y]
 >>> new
[None, None, None, None]

Can anyone help? Thanks very much in advance.


More information about the SciPy-user mailing list