kristoffer.lundgren at gmail.com
Sun Jan 2 01:43:40 CET 2011
I suspect I've found a documentation error in the above mentioned link (
http://docs.python.org/library/random.html); regarding random.randint(a, b),
the documentation says "Return a random integer N such that a <= N <= b",
however when actually using the function, it does seem to be a <= N < b.
Running Python 2.6, the built-in help returns
Base Class: <type 'builtin_function_or_method'>
String Form: <built-in method randint of mtrand.RandomState object at
randint(low, high=None, size=None)
Return random integers from `low` (inclusive) to `high` (exclusive).
Return random integers from the "discrete uniform" distribution in the
"half-open" interval [`low`, `high`). If `high` is None (the default),
then results are from [0, `low`).
which kind of hints that it should be "<".
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the docs