title: How to make random choose from a set in Python reproducible
body: <p>I wrote a simple sample code here. In fact, elements will be added or deleted from the set and a random element will be chosen from the set on each iteration in my program.</p>
  <p>But even if I run the simplified code below, I got different output every time I run the codes. So, how to make the outputs reproducible?</p>
  <pre><code>import random
  random.seed(0)
  x = set()
  for i in range(40):
      x.add('a'+str(i))
  print(random.sample(x, 1))
  </code></pre>