Answers for "how to get index of a list while looping in python"

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
4

how to loop the length of an array pytoh

array = range(10)
for i in range(len(array)):
  print(array[i])
Posted by: Guest on March-07-2020

Code answers related to "how to get index of a list while looping in python"

Python Answers by Framework

Browse Popular Code Answers by Language