Layers order with Python

Hi Community,

I created a simple “layer’s order” in Python, while learning the logic.
Not very impressive and not the most clever way but it took me 2 days to figure out the resolution. :open_mouth:

Anyway, hope it can be helpful for some Python beginners.

Best
layers.toe (5.56 KB)
layers.jpg

Unfortunately this approach is absolutely not working with higher amount of “layers” due to a conflict between the statements or I don’t know what. I will highly appreciate if someone propose a better idea of how to drive this.
layersX4.toe (16.8 KB)