+ 1
Is there a way to return random numbers in a certain range without the use of modules...just pure python code?
5 Respuestas
+ 3
You can use random module which comes inbuilt in python
+ 3
Or create a randome number generator from time and date calculation may be but it is not easy.
+ 1
Why should you feel like reinventing the wheel?
+ 1
Try out this code. It is a Python translation from my experimental pseudo-random number generator in C. See comment lines for more info.
https://code.sololearn.com/cJjrFCp3GiJe/?ref=app
0
Yeah, I don't know any better source for a seed than time. But at least the functions are straight Python. Instead of calling time() you could prompt the user for a seed value.