Home >>Python Random Module >Python Random getrandbits() Method
Python Random getrandbits() Method in python is used to returns an integer in the specified bits (size).
Syntax:random.getrandbits(n)
Parameter | Description |
---|---|
n | It is Required a number to specified the size, in bits. |
import random
print(random.getrandbits(12))
import random
print(random.getrandbits(15))