# Random Seed

*noun*

say it: **“RAN-dum SEED”** **/ˈrændəm ˈsid/**

The number a program's random numbers start from; the same seed gives the same sequence of random results every time the program runs.

## What is a **random seed**?

A **random seed** is the number Python's random numbers start from. Give the same seed and the same "random" results
come out on every run, which is what a test needs; libraries such as scikit-learn take one as `random_state`.

```python
import random
random.seed(7)
print(random.randint(1, 6), random.randint(1, 6))
random.seed(7)
print(random.randint(1, 6), random.randint(1, 6))   # the same two rolls again
```

## In a sentence

- “The split used a **random seed**, so everyone's training and test rows matched.”
- “With a **random seed** of 7, the dice game rolls the same numbers in every test.”

Level: Journeyman · [More Python terms at this level](https://www.ask-codey.com/glossary?category=python&level=3)

Updated: November 19, 2026

Source: https://www.ask-codey.com/glossary/random-seed
