title: different ways of running python script
body: <p>I am coming from C# background and I have hard time figuring out how to run python script. </p>
  
  <p>So, I wrote this simple recursive binary search and found online that I can do something like this:</p>
  
  <pre><code>def chop(array, search, lo, high):
  
      if lo &lt;= high:
           middle = (high + lo) /2
           if array[middle] == search:
               return 'true'
           elif search &gt; array[middle]:
               return chop(array, search, middle + 1, high)
           else:
               return chop(array, search, lo, middle -1)
       return 'false'
  
  
  
  if __name__ == '__main__':
      a = [1,2,3,4,5,6,7,8,9,10]
      print chop(a, 21, 0, len(a) -1)
  </code></pre>
  
  <p>the __main__ will be main my method to call the chop function from but it doesn't work. I have it saved in a test.py file. Also I though I can somehow run just the chop function from Python Shell, but I have no idea how to do it. Please advice. Thank you.</p>