[EMAIL PROTECTED] wrote:
> Hello everybody.
> 
> I'm wondering how to iterate over a tuple like this
> [A,B,C,D]
> while saving A and C in a list.
> 
> My problem is that C sometimes is a tuple of the same structure
> itself...
> 
> 
> thanks!
> korovev
> 
First of all [A,B,C,D] is a list not a tuple. (A,B,C,D) is a tuple.

Without a better example or explanation of what you are trying to do it is 
difficult, but I'll give it a try:

myTuple=(A,B,C,D)
for n, item enumerate(myTuple):
     if n in (0,2):
         myList.append(item)

-Larry
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to