[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>I can get list to be how I want it if I use the index value as follows:
>
> list = ("%s" + "," + "%s", ...) % (list_array[0], list_array[1], ...
>
>However, the list_array will never contain a constant number of items.
>So my dilema is how to loop/iter
Hi All -
Thanks to everyone for their input. The repsonses provided are exactly
what I was looking for!
Regards -
Shawn
--
http://mail.python.org/mailman/listinfo/python-list
> I am working on a project in which I generate an array of values
> (list_array). I need to use the values in this array to create list
> similar to the one below:
>
> list_array = []
> list = item1,item2,itemN...
>
> I am having difficulty in getting the values out of the original array.
>
>>> list_array = ['aaa','bbb','ccc']
>>> for item in list_array:
... print item + ',',
...
aaa, bbb, ccc,
(notice the comma at the end of the print statement: this causes the
suppression of the automatic newline)
Is this what you need?
--
Renato Ramonda
--
http://mail.python.org/mailman/
If you just want the items concatenated with a comma separator, the
following is what you need:
>>> list_arr = ["one", "two", "three"]
>>> list = ",".join(list_arr)
>>> print(list)
one,two,three
--
http://mail.python.org/mailman/listinfo/python-list
> list_array = []
> list = item1,item2,itemN...
My first recommendation would be that you not use "list" as
an identifier, as it's a builtin function. Odd bugs might
start happening if you redefine it.
> I can get list to be how I want it if I use the index value as follows:
>
> list =
Hi All -
I am working on a project in which I generate an array of values
(list_array). I need to use the values in this array to create list
similar to the one below:
list_array = []
list = item1,item2,itemN...
I am having difficulty in getting the values out of the original array.
I have