Python enumerate() and zip() built in functions

The enumerate() and zip() are the built in functions that can be used on a sequence.

 enumerate() :

enumerate will extract the index position and the value.

Example: Here we will use for loop to print the index and the value using enumerate function.

 

python enumerate function

 

zip():

The zip built in function can be used over two or more sequences. The zip function will extract the values in the sequences.

Example:

 

By using enumerate() and zip() at the same time, we can print the index as well as the values of multiples sequences such as a list.

Example:

Python Enumerate and Zip functions using for loop over multiple lists