Python Random getstate() Method
Example
Return the current state of the random generator:
import random
print(random.getstate())
Try it Yourself »
Definition and Usage
The getstate()
method returns an object with
the current state of the random number generator.
Use this method to capture the state, and use the
setstate()
method, with the captured
state, to restore the state
Syntax
random.getstate()
Parameter Values
No parameter values