Reverse values in python

Hi all,

I am trying to reverse the values generated by "for"loop

Import rhinoscriptsyntax as rs
for i in range(0,40):
pts = rs.addpoint(i,0,0)
rs.addsphere(pts,i/4)

so this is what i did first and now i want to reverse the values.Scale the spheres the opposite.
i tried reversed method as in general python and negative values.

How about this:

import rhinoscriptsyntax as rs

for i in range(0,40):
    pts = rs.AddPoint(i,0,0)
    rs.AddSphere(pts,(40-i)/4)

Is that what you need?

-Willem

1 Like

Thank u Willem… :ok_hand:

1 Like

or use range(40,0,-1).

Remember that range has signature range(start,stop,step). See the Python documentation on range for complete description.

/Nathan

Negative values are not working with python in rhino.