You are here : python_3randomrandomgetrandbits

random.getrandbits() - random

Returns a Python integer with k random bits. This method is supplied with
the MersenneTwister generator and some other generators may also provide it
as an optional part of the API. When available, getrandbits() enables
randrange() to handle arbitrarily large ranges.


Syntax

random.getrandbits(k)


Example


Output / Return Value


Limitations


Alternatives / See Also


Reference