This lesson is from the Real Python video course by Philipp Acsany.
Looping With Python enumerate() (Summary)
00:00
Congratulations! You finished a Python enumerate()
course, and you did quite some things. First, you explored how it is to iterate without the enumerate()
function, and then you used it, and you hopefully learned a little bit about it and why the enumerate()
function is useful.
00:21
Then you built your own enumerate()
function, my_enum()
, to get a little bit a feeling of what’s happening under the hood of enumerate()
.
00:30
And you tried it out by using the my_enum()
function. Python’s enumerate()
lets you write Pythonic for
loops when you need a count and the value from an iterable.
00:42
The big advantage of enumerate()
is that it returns a tuple with a counter and a value. So you don’t have to increment the counter yourself, and it gives you the option to change the starting value for the counter.
00:54
This is something that you explored by building your own enumerate()
function.
01:00
And that concludes Python enumerate()
: Simplify Looping With Counters! With enumerate()
, you now can count seasons, no matter how many there are.
You must own this product to join the conversation.