Created
December 20, 2016 19:36
-
-
Save molcay/6e9f0127ca63a1cb5bb185418c02f874 to your computer and use it in GitHub Desktop.
Iterate over list in Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| list_to_iter = [ ["a", "b"], ["c", "d"], ["e", "f"] ] | |
| for item in list_to_iter: | |
| print(item) | |
| for i in range(len(list_to_iter)): | |
| print(list_to_iter[i]) | |
| for (i, item) in enumerate(list_to_iter): | |
| print(i, item) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment