I am trying to iterate over a string and find all of the occurrences of a certain substring, like so:
contant = "old men old men old men"
def this (l,n):
while n < 20:
m = contant[l:].index("o")
l = m + 3
n += 1
print(m,l)
this(0,1)
Which will only return the nnumbers 0 3 and 5 8 over and over again, instead of iterating through the entire string.