My tuple looks something like this(for a particular set of generated value)
tTrains = [ (3, ), (1, 3), (6, 8), (4, 6, 8, 9), (2, 4) ]
Now, what I need to find is the length of longest tuple inside this tuple/list. I can always use a for loop, iterate over all the sub-tuples and do it. But I want to ask if there's a predefined function for the same.
Current Usage
This is what I am going to use as of now
max = 0
for i in range( len(tTrains) ):
if iMax < len( i ):
iMax = len( i )
,
in the tuples are actually important. A number in parenthesis is just a number, if you add the,
it becomes a 1-item tuple. (I know it's not relevant for you anymore. Just in case somebody else needs it) – Stamey