Python‎ > ‎operator‎ > ‎

operator.index()


Introduction
The operator return the value of as operator.__index__(a).

Syntax
operator.index()
__index__

Parameters
a=number

Import module
Importing module is required in the Shell window and the Editor window.

Examples
The method return the index(a).
 >>> operator.index(2)
2
>>> operator.index(0)
0
>>> operator.index(3)
3

The method return as operator.index(a).
 >>> operator.__index__(-1)
-1
>>> operator.__index__(0)
0
>>>



Comments