title: How do I create a list of random numbers without duplicates
body: <p>I tried using <code>random.randint(0, 100)</code>, but some numbers were the same. Is there a method/module to create a list unique random numbers?</p>
  
  <p><em>Note: The following code is <strong>based on an answer</strong> and has been added after the answer was posted. It is not a part of the question; it is the solution.</em></p>
  
  <pre><code>def getScores():
      # open files to read and write
      f1 = open("page.txt", "r");
      p1 = open("pgRes.txt", "a");
  
      gScores = [];
      bScores = [];
      yScores = [];
  
      # run 50 tests of 40 random queries to implement "bootstrapping" method 
      for i in range(50):
          # get 40 random queries from the 50
          lines = random.sample(f1.readlines(), 40);
  </code></pre>