The Python Enumerate Function

preview_player
Показать описание
How do you get a counter in that python for loop? In this video we talk about the enumerate function in python.

*********************
Learn More
*********************

*********************
More Content from Me
*********************

*********************
Connect with Me
*********************
Рекомендации по теме
Комментарии
Автор

1:17 What version of Python are you using because I am using python 3. When I typed this in, it gave me this:
['circle', 'triangle', 'square']
['circle', 'triangle', 'square']
['circle', 'triangle', 'square']

But, when I remade the program into this:
shapes = ['circle', 'triangle', 'square']

for counter, shapes in enumerate(shapes):
print(counter, shapes)

it had worked

splatmn
join shbcf.ru