Definition
The enumerate() function takes a collection and returns it as an enumerate object.
The enumerate() function adds a counter as the key of the enumerate object.
Syntax
enumerate(iterable, start)
Parameters
Parameter | Description |
---|---|
iterable | An iterable object |
start | A Number. Defining the start number of the enumerate object. Default 0 |
Examples
fruits = ('apple', 'orange', 'banana')
result = enumerate(fruits)
print(result)