Python

Python Menu

Python

Python enumerate() Function - Definition, Syntax, Parameters, Examples

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)

Introduction

Python Basics

Python Advance

Data Science Python Tutorials

Python Functions and Methods