Home >>Python Random Module >Python Random getstate() Method

Python Random getstate() Method

Python Random getstate() Method

The getstate() method in python is used to capture the state and returns an object of the random number generator with the current state.

Syntax:
random.getstate()
Here is an example of Python Random getstate() Method:

import random
z = random.getstate()
print(z)