I can’t understand how to debug this error. See below.
Use rs.GetInteger() instead as you are presumably looking for an integer number of points. Alternatively you can turn your float into an integer with the int() function.
The error message is telling you that you are providing a float to the range function but it wants an integer.
Thanks for the explanation!