+ 12
Python Module [RANDOM]
Please I need more insight on the differences between two methods in the Random module: randrange and randint. And also tell me more useful Random methods.
13 odpowiedzi
+ 12
@justone ...
you will find your answer..in @David's post
+ 10
No problem @Nerf. Hope you'll enjoy SoloLearn
+ 10
No problem @Nerf. Hope you'll enjoy SoloLearn
+ 9
How can I get the documentation, is it on Python site??
+ 8
randint includes the specified upper bound; randrange works more like Python range: the specified upper bound is not included in the range. So e.g. randint(6,8) will yield 6, 7 or 8. But randrange(6,8) will yield 6 or 7.
+ 7
Just reviewed the official docs.
randint (a,b) is simply an alias for randrange(a,b+1).
Which is consistent with my first answer.
+ 7
Here is a link to the official documentation
https://docs.python.org/3/library/random.html
+ 7
what's that @Elisei??
+ 5
Besides Python Official Documentation, this site is very helpful on finding Python modules explanation and examples:
https://pymotw.com/3/random/index.html
+ 2
You can simply search “Random module python” on google and it should show up.
+ 1
RandRange- Uses an external command (getrandbits), and skips the third paramater (to my knowledge)
RandInt- Just chooses a random int between (and including) X & Y
+ 1
I don't know I'm a noob i installed this app today