-1
a = "a4b4t8a3a3w2q5a8o9i8"
for i in range(0, len(a)):
  if a[i].isdigit() is False:
    print("detected letter")
    i +=5 #this does not increase the i by 5 each tiem I find a letter

This does not help the index 'i' jump forward by 5. Why?

ERJAN
  • 22,540
  • 20
  • 65
  • 127
  • 2
    I found this thread: https://stackoverflow.com/questions/14785495/how-to-change-index-of-for-loop-in-python Think this is the answer you are looking for. – tifi90 Nov 27 '18 at 16:39

1 Answers1

0

Try this

a[i + 5]

instead of

i + 5
mikeg
  • 444
  • 4
  • 13