[Python] Use enumerate() function to output index and element at the same time
Last Updated on 2020-09-25 by Clay
Introduction
enumerate()
is a function often used in Python. Its usage is very simple, just only need use enumerate(iterable, start_index)
. The first parameter enters the iterable object, and the second parameter enters the first number to be counted (Calculate from 0 by default).
Let's take a look at a simple sample code.
Read More »[Python] Use enumerate() function to output index and element at the same time