How can I perform below code in python
I am new to python and getting troubled, please could someone help

```
objects = [............] // Array
for (i=0; i<objects.length(); i++) {
    if(readElement(objects[i])){
        //do something
    } else {
      i--; // so that same object is given in next iteration and readElement cant get true
    }
}

```