Answers for "iterate list from specific index 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
0

python iterate with index

for index, item in enumerate(iterable, start=1):
   print index, item
Posted by: Guest on November-27-2020
0

loop through list, find specific number and output element's index

loop through list, find specific number and output element's index
numbers = [1,5,7,8,2,34,5,23,145,87]
N = 3
if N in numbers:
  print(numbers.index(N))
elif N not in numbers:
  print(-1)
Posted by: Guest on January-29-2020

Code answers related to "iterate list from specific index python"

Python Answers by Framework

Browse Popular Code Answers by Language