All of the solutions, including mine, show the problem of converting from a "real number" random number to an integer random number.
In the case of using int() to truncate the decimal part, the likelihood of obtaining the upper limit of the random range is very low - ie the probability of rand() returning exactly 1.0.
In the case of using round() to remove the decimal part, the likelihood of obtaining both the upper & lower limit is half that of obtaining any value in between, ie probability of 1 is equivalent of probability of rand()*999 returning less than 0.5, similarly probabilty of obtaining 1000 is probability of rand()*999 return greater than 998.5, whereas values in between have double the range.
To obtain an integer random number generator with all values having equal probability of occuring is more than a trivial one liner, where the range of rand() is 0.0 -> 1.0.
Len Speed