My code for a random number generator keeps giving the same outcome
niteeshtapre (0)

This is the code

from random import seed
from random import randint
print('Numbers generated are below')
seed(1)
for _ in range(10):
value = randint (1 , 10)

print (value)

The outcome is always
3
10
2
5
2
8
8
8
7
4

You are viewing a single comment. View All
PDanielY (983)

@niteeshtapre but why? you don't even need the seed function. The only purpose of the seed command is to make random.randit have the same value