title: How to tune random.choice probability - python -
body: <p>I made a function that randomly selects one from a list of texts.</p>
  <pre><code>def ttc(*arg):
      a = random.choice([*arg])
      return ''.join(a)
  
  print(ttc(&quot;Price&quot;, &quot;Condition&quot;, &quot;Loan&quot;))
  print(ttc(&quot;entertainment&quot;, &quot;geese&quot;, &quot;Uruguay&quot;, &quot;comedy&quot;, &quot;butterfly&quot;))
  </code></pre>
  <p>But I found it necessary to make certain words have a higher probability of being selected.</p>
  <p>For example, can we change the probability of being selected sequentially from the front of the list by 50% 30% 20% like this?</p>