title: Calculating Time and Space Complexity of xrange(), random.randint() and sort() function
body: <p>What is the time and space complexity of <code>xrange()</code>,<code>random.randint(1,100)</code> and <code>sort()</code> function in Python</p>
  
  <pre><code>import random
  a = [random.randint(1,100)  for i in xrange(1000000)]
  print a 
  a.sort()
  print a
  </code></pre>