Answers for "python how to iterate with index through array"

27

python3 iterate through indexes

items=['baseball','basketball','football']
for index, item in enumerate(items):
    print(index, item)
Posted by: Guest on May-07-2020
0

python for looop array value and index

cars = ["tesla", "audio" , "bwm", "VW", "seat"]

for i , value in enumerate(cars):
  print(f'value is: {value}, and index = {i}')
Posted by: Guest on August-11-2021

Code answers related to "python how to iterate with index through array"

Python Answers by Framework

Browse Popular Code Answers by Language