title: How to generate random number from desired range using python
body: <p>i have a list with 9000 list items  as strings,  i want to select 4000 instances randomly amongst them. how can i achieve this.
   I have write down a code. </p>
  
  <pre><code>from random import randint
  for r in range(9000):
      print(randint(9000))
  </code></pre>
  
  <ol>
  <li>first i will generate the random 4000 random number</li>
  <li>and then list members will be picked up by the selected random numbers 
  I have write down a code which is showing an error code is as given bellow</li>
  </ol>