Re: list looping error

2006-12-29 Thread tkpmep
What you really want to write is for i in x: for j in i: print j The outer loop iterates over the tuples in the list, while the inner loop iterates over the elements of each tuple. So j (in your example) is always an integer, and is therefore unsubscriptable, which is exactly what the

list looping error

2006-12-29 Thread Gigs_
i have created list x: >>> x = [(12, 22, 11), (13, 22, 33)] and want to print each number in tuple >>> for i in x: for j in i: print j[0] but I get this error. What does it means? Traceback (most recent call last): File "", line 3, in print j[0] T