it is possible to not increment count in for loop in case an error happen, like this example
for i in range(10):
try:
print(i)
except: # if and error happen in i == 5 the next iteration will be 5 not 6
pass
I want to repeat the same iteration when the error happen. And thanks in advance.
range()if you want more control over how it increments.for loopin python is technical aforeach loop, you should change your loop to awhile loopto have more control.range()it's just example it could be list.10times including erros or repeat each iteration until it doesn't throw an error?