💾 Archived View for tris.fyi › pydoc › _random captured on 2023-04-26 at 13:34:10. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2022-01-08)

-=-=-=-=-=-=-

Back to module index

Go to module by name

_random

Module implements the Mersenne Twister random number generator.

Classes

Random

Random() -> create a random number generator with its own internal state.
getrandbits(self, k, /)

  getrandbits(k) -> x.  Generates an int with k random bits.
getstate(self, /)

  getstate() -> tuple containing the current state.
random(self, /)

  random() -> x in the interval [0, 1).
seed(self, n=None, /)

  seed([n]) -> None.

  Defaults to use urandom and falls back to a combination
  of the current time and the process identifier.
setstate(self, state, /)

  setstate(state) -> None.  Restores generator state.