title: Need to understand the functionality of string.count() function
body: <p>I was trying to understand the functioning of string.count basically
  The documented definition of it is </p>
  
  <blockquote>
    <p>string.count(s, sub[, start[, end]])<br>
    Return the number of (non-overlapping) occurrences of substring sub in string s[start:end]. Defaults for start and end and
    <strong>interpretation of negative values are the same as for slices.</strong></p>
  </blockquote>
  
  <p>Now what's the exact meaning of last line here which is bold actually. I did some random experiment with this function </p>
  
  <pre><code>In [19]: a
  Out[19]: 'ab'
  In [23]: string.count(a,'ab'[1:3])
  Out[23]: 1
  
  In [24]: string.count(a,'ab'[1:1])
  Out[24]: 3
  
  In [25]: string.count(a,'ab'[-1:1])
  Out[25]: 3
  
  In [26]: string.count(a,'ab'[-1:0])
  Out[26]: 3
  
  In [27]: string.count(a,'ab'[1:4])
  Out[27]: 1
  
  In [28]: string.count(a,'ab'[1:100])
  Out[28]: 1
  
  In [29]: string.count(a,'ab'[100:100])
  Out[29]: 3
  
  In [30]: string.count(a,'ab'[:])
  Out[30]: 1
  
  In [31]: string.count(a,'a'[:])
  Out[31]: 1
  </code></pre>
  
  <p>Can anybody explain me why some times I am getting result as 1 and why sometimes 3 here. Overall I need to understand how this function works exactly ?</p>