Following code block works and it seems pretty legit to me. There is TP two times in TP Tutorials Point TP string so the number of matches should be 2. Also the iteration over this list should work.
s = 'TP Tutorials Point TP'
out = re.findall(r'TP', s)
assert len(list(out)) == 2
# this loop will print 2 times matched string
for m in out:
    print(m)
But what is going on here?
s = 'TP Tutorials Point TP'
out = re.finditer(r'TP', s)
# seems OK so far
assert len(list(out)) == 2
# !!! no output here !!!
for m in out:
    print(m)
Why I'm unable to iterate over returned output of finditer method? In following post it is shown that finditer should also work. My python version: 3.8.10
 
     
     
    