[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

I'm wrong or Will we fix the ducks limp?

On Saturday, 4 June 2016 02:04:43 UTC+10, Michael Selik  wrote:

> > That totally makes sense I was just double checking, had hoped I could
> > create a variable assign it to a list and append in one stroke.
> >
> In fact you can! It's called a "list comprehension"
>     pyqFiles = [pq(my_dir + filename) for filename in sorted(file_list)]

Actually thats where I was coming from I can create a list with a list comprehension in one go, but I cant create a list with an append method pf.append(thing) in one go .