Re: Member index in toples

2006-06-01 Thread Tim Chase
> I have a tuple like this: > > T = ("One","Two","Three","Four") > > Is there any built-in way to find what is the index of "Two" withouot > looping within the tuple? > > Is the same feature available for lists or dictionaries? Lists have a index() method. For the tuple, you can convert it t

Re: Member index in toples

2006-06-01 Thread Klaus Alexander Seistrup
A.M skrev: > I have a tuple like this: > > T = ("One","Two","Three","Four") > > Is there any built-in way to find what is the index of "Two" > withouot looping within the tuple? > > Is the same feature available for lists or dictionaries? Lists have an index method: #v+ >>> L = list(T) >>> L.i

Re: Member index in toples

2006-06-01 Thread skip
Alan> T = ("One","Two","Three","Four") Alan> Is there any built-in way to find what is the index of "Two" Alan> withouot looping within the tuple? One thing to consider is the different uses intended for tuples and lists. Tuples should not be treated as immutable lists, though many p