> 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
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
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