A basic loop (while) question

Hi,

Im a new rhinoPython user…i have a question…what´s the difference between first image and second one? Should the variables always be inside the while function?

i want to get something like first image…points inside virtual box

Regards,

Felipe

In the first one you are generating a random x y and z value each time you go through the loop (so a 1000 times).
In the second one the random x y and z value is generated before looping. So it uses the same x y and z value that has been created before the loop. Therefore it’s adding a point in the exact same spot a 1000 times.

For info you can simplify the final line to count += 1

ok…thanks for the answer. its clear now.
…thanks for the tip.

regards,

Felipe