title: python : get random value not exist in list
body: <p>I have a the following code:</p>
  
  <pre><code>def random_generate(list)
      x = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
      x = list(x)
      random = choice(x)+choice(x)+choice(x)
  </code></pre>
  
  <p>Where <code>list</code> is a list of 3 characters string, e.g. <code>["abc","acd","aza"]</code>, and I call my function like:</p>
  
  <pre><code>random_generate(["abc", "acd", "aza"])
  </code></pre>
  
  <p>I want to generate a 3 characters string <code>random</code>, using characters from <code>x</code>, but which is not in <code>list</code>, e.g. <code>"aef"</code>.</p>
  
  <p>I know I can make a loop until I get a string that is not in <code>list</code>, but it is not very efficient. Could someone provide me some hint on how to generate a string not in <code>list</code>?</p>