Python List - Index Method

Method Name: index(value_in,occurence_in=1)

Method Overview:

The index method returns the index of the nth occurence of the value_in element.

Parameters: 

value_in             -  value for which the index to be found in the python list
occurence_in    - occurence count for which the index to be found for the specified element in the python list

Exceptions:

A ValueError will be raised if the specified value is not found.

>>> GalileanMoons=["Io", "Europa", "Ganymede", "Callisto"]

>>> GalileanMoons.index("Callisto")

3


Copyright 2024 © pythontic.com