(Oct-08-2018, 12:08 PM)zhruser Wrote: Use this to simulate a result of rolling:
import random
r = int(random.random()*6)
Please, use python tags when post code.
Also, you may find interesting to read this
https://docs.python.org/3/library/random...r-integers
Quote:Changed in version 3.2: randrange() is more sophisticated about producing equally distributed values. Formerly it used a style like int(random()*n) which could produce slightly uneven distributions.
in this case one should use
random.randint()
in order to get equal distribution (i.e. given the required probability of 1/6).
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs