It doesn't: firstly because it's not
random.choices
it's
random.choice
, and secondly because of statistics:
import random
print(random.choice([0,1,2,3]))
print(random.choice([0,1,2,3]))
print(random.choice([0,1,2,3]))
print(random.choice([0,1,2,3]))
print(random.choice([0,1,2,3]))
print(random.choice([0,1,2,3]))
print(random.choice([0,1,2,3]))
print(random.choice([0,1,2,3]))
print(random.choice([0,1,2,3]))
print(random.choice([0,1,2,3]))
Gives me
1
0
3
1
1
1
1
3
2
2
Then this:
2
0
2
0
0
2
1
0
2
1
Notice that the first test has a "run" of '1's - the smaller your sample, the more likely a "run" is: with only four elements to choose from, it's quite possible that you will get the same value several times in a row. Run it a thousand times, and the count's will even out, but in the short term you should expect "odd looking" results.