At the suggestion , did the following:
from random import randint
def rrand(n):
if randint(0,9) < n:
return randint(0,1)
return randint(2,9)
n - charge % ratio, in this case 2, i.e. 20%
(0,9) - ranges
Here is an example of 10 tests with 1000 calls to the function:

According to the results we see that approximately our conditions are met, we got ~20% some answers, and ~80% of the other. In my case, it suits me.