Hi Chandra.
Thanks for the comment.
To my knowledge, the randint() actually includes the number at the end, unlike range does. If you use range(0,2) it will go from 0 to 1, but randint(0,2) will go from 0 to 2, Since that is three values — 0, 1, 2, getting one of those values would be 33% 1/3.

I hope that cleared it up :)

Try this loop to test it out:

for i in range(0,20):
rand_var = random.randint(0,2)
print (f’{rand_var}’)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store