Home >>Python Random Module >Python Random seed() Method
Python Random seed() method in python is used to set the integer starting value used in random number generator and by using seed() method you can customize the start number of the random number generator.
Syntax:random.seed(a, version)
Parameter | Description |
---|---|
a | It is Optional. The seed value needed to generate the next random number and its default value is None |
version | Its default value is 2. |
import random
random.seed(8)
print(random.random())
import random
random.seed(5)
print(random.random())
random.seed(12)
print(random.random())