Re: convert list into a comma separated string

2010-10-04 Thread Aaron Sterling
On Mon, Oct 4, 2010 at 1:41 AM, ashy wrote: > Hi All, > > I am writing a django function in which I have a following list: > li = ['a','b','c'] > I want to create a string from the list which should look like > str = 'a,b,c' > > string_ = "".join(li) str is a built in class. You shouldn't shadow

Re: List compare is there something better than a double loop?

2010-12-02 Thread Aaron Sterling
> > > I'm building a store that has a product_list (class ProductList: > store, name, description) that contains .products (class Product: > name, description, price etc...) > > If you're expecting them to be in the same order, you could do all(product == cartitem.product for product, cartite