get list for loop python code example
Example 1: python3 iterate through indexes
items=['baseball','basketball','football']
for index, item in enumerate(items):
print(index, item)
Example 2: list loop python
list = [1, 3, 5, 7, 9]
# with index
for index, item in enumerate(list):
print (item, " at index ", index)
# without index
for item in list:
print(item)