title: How to make a function that would give one output 20% of the time, another output 10% of the time, and another output 70% of the time?
body: <p>I attempted </p>
  
  <pre><code>import random
  from statistics import mode
  
  numlist = []
  for i in range(6):
      numlist.append(random.randint(1, 4))
  for i in range(3):
      numlist.append(random.randint(1, 3))
  for i in range(1):
      numlist.append(random.randint(1, 2))
  
  print(mode(numlist))
  </code></pre>
  
  <p>Which I attempted to give 1 number 70% of the time, another number 20% of the time, and another number 10% of the time. 
  However, working out the math, the split ends of being 50%, 30%, 20%</p>