Is randint module simply takes random values?or whether it follows any patteren..or some conditions?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Is randint module simply takes random values?or whether it follows any patteren..or some conditions??

28th Oct 2016, 11:32 AM
Jim Joseph
Jim Joseph - avatar
3 Answers
+ 6
It follows a pattern. Now some languages have a better random number generator than others. A computer can NEVER do fully random number generations. It is called a pseudo-random number generation. If you were to start it with two computers at the exact same time (or just with the same conditions) it will ALWAYS return same values.
28th Oct 2016, 12:14 PM
nedas
nedas - avatar
+ 1
you can define seed for generation (and if you put in the same seed, generate a number, terminate program and repeat process, you will always get same number), but if you dont put any, it takes current time for seed (which is random enough for humans). and the only true random generation is by measuring cosmic radiation. for more exact process, you can google it
6th Nov 2016, 10:50 AM
Redstone Tehnik
Redstone Tehnik - avatar
0
aah.thanks nedas.
28th Oct 2016, 4:21 PM
Jim Joseph
Jim Joseph - avatar