python enumerate function

If you use the enumerate function in python, it will return the index together when you run the extended for loop.

>>> for i, s in enumerate(['a', 'b', 'c']):
...     print i, s 
... 
0 a
1 b
2 c
>>> 
>>> for i, s in enumerate([('a', 'b'), ('c', 'd'), ('e', 'f')]):
...     print i, s
... 
0 ('a', 'b')
1 ('c', 'd')
2 ('e', 'f')

I don't plan to use it for now, but it looked interesting.

Recommended Posts

python enumerate function
python function ①
[Python] function
python function ②
About the enumerate function (python)
Python> function> Closure
[Python] Generator function
Python> function> Inner function
Python function decorator
[Introduction to Udemy Python3 + Application] 45. enumerate function
About function arguments (python)
Function execution time (Python)
Python function argument summary
Python print function (sequel)
Python: About function arguments
Time floor function (Python)
Create a function in Python
Python
Use callback function in Python
[python] Value of function object (?)
ntile (decile) function in python
[Python] Etymology of python function names
About python beginner's memorandum function
enumerate
python url setting include function
Python #function 2 for super beginners
Nonlinear function modeling in Python
Draw implicit function in python
Python higher-order function (decorator) sample
Immediate function in python (lie)
Call a Python function from p5.js.
Implement R's power.prop.test function in python
Function argument type definition in python
Included notation in Python function arguments
Write AWS Lambda function in Python
Measure function execution time in Python
[Python] Make the function a lambda function
Python #len function for super beginners
Function synthesis and application in Python
Basic Python operation 2nd: Function (argument)
How to use python zip function
[Python] Difference between function and method
[Python] Function arguments * (star) and ** (double star)
[OpenCV; Python] Summary of findcontours function
Python3> Functions> Function Renaming Mechanism> f = fib
Python basics ⑤
python + lottery 6
Create a Python function decorator with Class
Python Summary
Built-in python
Python comprehension
Python technique
Studying python
Python 2.7 Countdown
Python memorandum
Python FlowFishMaster
Python service
python tips
Python basics
Python memo
ufo-> python (3)