Be a Python Pro with Enumerate

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
do you code in Python if you don't do this one thing it's a dead giveaway that you're a complete Noob it's super common in code to want to iterate over a list of things and in Python that's really easy with a for Loop but what if when iterating you want to keep the index location of each item one way is to iterate over a range with the length of your list this works but if you do it you're a certified new another way to do this is to create a counter which you can increment every time you iterate over an item in your Loop this also works but if you do it you're a certified double Noob so how do you do it you ask quit your whining I'm about to show you we can use the built-in python function enumerate now when we Loop over our numerated list we get both the index and the item in the list not only will this make your code cleaner but it will show that you're a certified python Pro
Info
Channel: Rob Mulla
Views: 981,697
Rating: undefined out of 5
Keywords: Python, Coding, Enumerate, Coding tips, Python tips, For loop, Enumerate python, Rob mulla
Id: apoWKUpNvas
Channel Id: undefined
Length: 0min 55sec (55 seconds)
Published: Tue Jan 17 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.