title: Import Error in Python Textbook Sample Program
body: <p>I am following a Python textbook and it contains an error in a sample program below:</p>
  
  <pre><code># Random Access
  # Demonstrates string indexing
  
  import random
  
  word = "index"
  print "The word is:", word, "\n"
  
  high = len(word)
  low = -len(word)
  for i in range(10):
      position = random.randrange(low, high)
      print "word[", position, "]\t", word[position]
  
  raw_input("\n\nPress enter to exit.")
  </code></pre>
  
  <p>Python complains with the following error:</p>
  
  <pre><code>File "C:\Python27\random.py", line 3, in &lt;module&gt;
  import random   
  
  File "C:\Python27\random.py", line 11, in &lt;module&gt;
      position = random.randrange(low, high) AttributeError: 'module' object has 
      no attribute 'randrange'
  </code></pre>
  
  <p>Any ideas how to fix this? I am new to programming and python.
  I have used the "import random" code before and it worked fine.</p>