Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> I can't speak for Python, but in Java it's quite simple to do it right

http://docs.python.org/library/random.html#random.randint



Actually the python equivalent of "Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive)" would be random.randrange(0, n, 1)

random.randint(a, b) returns a uniformly distributed int value between a (inclusive) and b (inclusive).

</nitpick>




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: