title: IndexError: list index out of range in array search
body: <p>I'm making a simple program in Python to perform a linear search. But when I run this program it gives me this error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Users\raj\Documents\EclipseProject\PythonProject1\myProgram.py", line 25, in &lt;module&gt;
      if array[myNumber] == search:
  IndexError: list index out of range
  </code></pre>
  
  <p>Here is my program:</p>
  
  <pre><code>array = []
  
  numCase = input("Enter your number cases: ")
  
  numCase = int(numCase)
  array = [numCase]
  
  print("Enter the number with", numCase, "times.")
  
  for i in range(0, numCase):
      myNumber = input()
      myNumber = int(myNumber)
      array = [myNumber]
  
  print("Enter the values which you're looking for: ")
  search = input()
  search = int(search)
  
  for c in range(0, numCase):
      if array[myNumber] == search:
          print(search, "is present at", (c+1))
          break
  
  # If number is absent!!
  if c == numCase:
      print(search, "is not present!!")
  </code></pre>