Skip to content
Daniel Zimmermann edited this page Mar 4, 2021 · 5 revisions

#https://stackoverflow.com/questions/39714326/random-number-generation-using-python

def generate_random_number(seed=0, m=2 ** 32, a=1664525, c=1013904223):

`seed = (a*seed + c) % m`

`return seed, seed / (2**32-1)`

s = 15

for _ in range(15):

`s, random_number = generate_random_number(seed=s)`

`print(s)`

`print(random_number)`
Clone this wiki locally