[Tutor] Sorting more than one list

Tony Meyer tameyer at ihug.co.nz
Fri Apr 1 05:25:46 CEST 2005


> What's b.index(x) do?
> 
> I'm guessing the for a list Delta = ["a,"b","c"], you get 
> 
> Delta.index("b")
> 
> 1
> 
> Am I right? 

Yes.  For future use, the easiest way to answer a question like that is to
do:

>>> help([].index)
Help on built-in function index:

index(...)
    L.index(value, [start, [stop]]) -> integer -- return first index of
value

Or, if you have an idea, just try it out:

>>> Delta = ["a","b","c"]
>>> Delta.index("b")
1

=Tony.Meyer



More information about the Tutor mailing list