Python Random setstate() Method

Definition and Usage

The setstate() method is used to restore the state of the random number generator back to the specified state

Use the getstate() method to capture the state

Syntax

random.setstate(state)

Parameter Values

Parameter Description
state Required. A state object. the setstate() method will restore the state of  the random number generator back to this sate.