title: python: choose element from a list following a certain probability
body: <p>I'm looking for a python function that would allow me, given a list and a certain probability, to return only the elements that "pass" the lottery. For instance:</p>
  
  <pre><code>my_list = ['A', 'B', 'C']
  my_probability = 0.66 # The probability for an element to stay in the list
  winner = THE_RANDOM_FUNCTION(my_list, my_probability)
  print(winner)
  &gt;&gt; ['A', 'C'] # Could be a different result but that only an example
  </code></pre>
  
  <p>So I want the function to do a lottery (with the given probability) for every element in the list and to keep it in the result list if it passes the lottery. </p>
  
  <p>Is there such function in the standard library or should I implement it?</p>