Loops in Deluge

Loops in Deluge

Hi,

Can someone tell me how I do a simple loop in deluge?

For example, if i have a variable "X" containing a number of loops to perform, i would like to perform an action X amount of times.

X = 10;
do while (Y < X){
      // ... do something
}

to further explain, the equivalent in PHP of what i am trying to acheive would be:

$X = 20;
for($Y = 1; $Y < $X; $Y++ ){
      // ... do something
}

Thanks