>>> a = [3,4,5,6]
>>> for i, val in enumerate(a):
... print i, val
...
0 3
1 4
2 5
3 6
>>>
More Related Contents:
- How to iterate through two lists in parallel?
- Transpose/Unzip Function (inverse of zip)?
- Are lists thread-safe?
- Python List vs. Array – when to use?
- Getting the index of the returned max or min item using max()/min() on a list
- How can I iterate through two lists in parallel?
- Getting a list of values from a list of dicts
- Find and replace string values in list
- Pairs from single list
- Splitting a list based on a delimiter word
- How do you pick “x” number of unique numbers from a list in Python?
- Naming conflict with built-in function
- Confused about __str__ on list in Python [duplicate]
- join two lists of dictionaries on a single key
- Assigning values to variables in a list using a loop
- Python – How to sort a list of lists by the fourth element in each list? [duplicate]
- Confusing […] List in Python: What is it?
- How to delete an item in a list if it exists?
- How to get all combination of n binary value? [duplicate]
- Convert a columns of string to list in pandas
- Flattening a list recursively [duplicate]
- remove None value from a list without removing the 0 value
- Python: Remove Duplicate Items from Nested list
- Changing one dict changes all dicts in a list of dicts [duplicate]
- Python string.join(list) on object array rather than string array
- How to sort multidimensional array by column?
- How to sort a 2D list? [closed]
- sum each value in a list of tuples
- How do I send list of dictionary as Body parameter together with Files in FastAPI?
- In what case would I use a tuple as a dictionary key? [closed]