In Python, a for
loop is usually written as a loop over an iterable object. This means that you don’t need a counting variable to access items in the iterable. Sometimes, though, you do want to have a variable that changes on each loop iteration. Rather than creating and incrementing a variable yourself, you can use Python’s enumerate()
to get a counter and the value from the iterable at the same time!
In this course, you’ll see how to:
enumerate()
to get a counter in a loopenumerate()
to display item countsenumerate()
enumerate()
What’s Included:
Downloadable Resources:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4