Deleting cubes from a pyramid and layering the levels

Hey everyone,

first of all thanks for the help.

Let me get to the point. I created a pyramid out of cubes but i want to delete some of them but i seem not to suceed in that. Also i want to layer every level on that pyramid but again I dont know how to script that.

I will attach and write the code below:

Script.zip (346 KB)

Thank you very much for the help (ps im new to blender and this forum . Also if you guys think i could change things please let me know.

Have a nice day
Rodod

I still cant figure it out by my self, so if some one could help me pls :confused:

Hey does any one has the answer to this ?